使 ExpressionEngine .htaccess 允许对 index.html 进行评论

发布于 2024-09-11 05:38:44 字数 1449 浏览 3 评论 0原文

我在 ExpressionEngine 上遇到了一个非常奇怪的问题。我有一个实时测试网站这里

本质上,如果您尝试对索引的“每日问题”发表评论,您会得到正确的重定向,但评论永远不会到达数据库。

如果我删除 .htaccess 并将控制面板中的站点索引页设置为 index.php,那么一切都很好。但随着 .htaccess 和 index.php 的删除,事情变得一团糟。

以下是我的 .htaccess 文件的注释:

RewriteEngine on 
RewriteCond $1 ^(weblog|member|search|site|rss|search|contact|show|commentary|include|about|blog|tags|preview|P[0-9]{2,8}) [NC] 
RewriteRule ^(.*)$ /skad/index.php?/$1 [L]

有任何解决此问题的提示或我可能出错的地方吗?如果有任何帮助,您可以查看我的文件夹结构的屏幕截图

非常感谢您提供的任何答案或简单的帮助。

更多:此外,这里还有博客条目上的成功帖子的标题和索引上的帖子失败

更新:我最近确实发现了一些奇怪的事情。具有相同的后端设置:后端设置 http://droplr.com/1sMXc9+ 和相同的代码:相同的代码http://droplr.com/1sN09A+

我得到http://localhost:8888/skad 作为一种表单操作,并且 http://skadaddlemedia.com/v2/v2/index.php 作为其他表单操作。

此时,我完全不知道发生了什么。

I've got a really quirky issue going on with ExpressionEngine. I've got a live test site here.

Essentially, if you attempt to comment on the index's 'Question of the Day,' you get a proper redirect, but the comment never gets to the database.

If I remove my .htaccess and set the site's index page in my control panel to index.php, then all is well. But with the .htaccess and index.php removed, things go haywire.

Here are the comments of my .htaccess file:

RewriteEngine on 
RewriteCond $1 ^(weblog|member|search|site|rss|search|contact|show|commentary|include|about|blog|tags|preview|P[0-9]{2,8}) [NC] 
RewriteRule ^(.*)$ /skad/index.php?/$1 [L]

Any tips to troubleshoot this or ideas where I could be going wrong? If it's any help, you can see a screenshot of my folder structure.

Thanks so much for any answers or simply help that you can give.

More: Also, here are headers for a successful post on a blog entry and a failing post on the index.

Update: I did recently find something else strange. With identical backend settings:backend settings http://droplr.com/1sMXc9+
And identical code:identical code http://droplr.com/1sN09A+

I get http://localhost:8888/skad as one form action and http://skadaddlemedia.com/v2/v2/index.php as the other form action.

At this point, I'm completely lost as to what is going on.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你怎么这么可爱啊 2024-09-18 05:38:44

这 ”?” RewriteRule 中的 index.php 之后表明您位于将 PHP 作为 CGI 脚本运行的服务器上,因此需要“强制查询字符串”,对吗?这可能是问题中的问题的辅助因素,但具有此要求可能会使事情变得复杂。看起来您托管在 Site5...我没有使用它们的经验,但您可以尝试此处建议的解决方法: http://expressionengine.com/wiki/Workaround_for_Forced_Query_Strings/

the "?" after index.php in the RewriteRule suggests that you are on a server running PHP as a CGI script and thus requires the "forced query strings", correct? This may be ancillary to the problem in the question, but it can complicate things to have this requirement. Looks like you're hosted at Site5... I have no experience with them but you might try the workarounds suggested here: http://expressionengine.com/wiki/Workaround_for_Forced_Query_Strings/

月依秋水 2024-09-18 05:38:44

尝试将 [L] 更改为 [L,QSA] 看看是否有帮助。

Try changing [L] to [L,QSA] to see if it helps.

挽手叙旧 2024-09-18 05:38:44

我不确定,但我认为 CI 和 EE 与 htaccess 的工作方式几乎相同,所以这可能会对您有所帮助。它是由一位名叫 Ethan 的 CI 大师写的,他不记得姓氏了,但他在 CI 社区中非常活跃。不管怎样,你的 HTACCESS 文件的方式确实已经被放弃了,新的方法要容易得多,而且你不必声明你排除的文件夹,这是自切片面包以来对于 MVC 或任何框架的用户来说最好的事情,我只是爱它。

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

我可以向你保证,如果这是一个 htaccess 问题,这个 bugger 会修复它,但接下来的事情是你不必对它做任何事情,只需将其放入,你永远不必再次编辑它,我发誓。太棒了,就像夏天的炸鸡一样美味!

请记住,首先测试它,只需将其替换为当前的位置即可,您将不需要您承诺的所有其他疯狂的东西。

I'm not sure but i think that CI and EE are pretty much the same as to the way the htaccess works so this may help you out. It is by a CI guru named Ethan, can't remember the last name, but he is very active in the CI community. Anyway the way that your HTACCESS file is has really been abandoned the new way to do it is a lot easier and you don't have to state your excluded folders it is the best thing since sliced bread for users of MVC or any frameworks i just love it.

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

i can gurentee you that if it is a htaccess issue this bugger will fix it but the bext thing is you dont have to do a thing to it just drop it in and you never have to edit it again i swear by it. so freaking good like fried chicken in the summer yummy!

remember test it first by just dropping it in place of your current one you wont need all that crazy other stuff you got there in yours promise.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文