【发布时间】:2012-06-23 23:09:18
【问题描述】:
一段时间以来,我一直在我的 .htaccess 文件中使用以下代码来使 EE URL 工作,而不需要 URL 中的 index.php。我发现虽然我从爬行工具中得到了一些报告,我得到了重复的内容,因为 /lorem/ipsum/ 也在某个地方弹出 /index.php/lorem/ipsum/。
我知道这可能是由于在 URL 中引用 index.php 的杂散链接造成的,但我想通过强制 index.php 退出链接来缩小差距。我环顾四周,但似乎找不到如何强制它。
RewriteEngine On
RewriteBase /
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
【问题讨论】:
标签: .htaccess expressionengine