【发布时间】:2012-06-11 21:24:51
【问题描述】:
我在我的 Windows 7 机器上安装了 WAMP v2.2,并启用了虚拟主机。
我已经为我的一个本地站点成功安装了 ExpressionEngine,并且一切正常,除非我尝试使用 approved .htaccess method 从 URL 中删除 index.php。如果index.php 不存在,我仍然会收到 404 错误,但页面显示正常,URL 中有index.php。
我确保在 Apache 菜单中检查了重写模块:
。这个方法我在商业主机上成功用过几十次了,难住了。
pvledoux 更新:
<IfModule mod_rewrite.c>
RewriteEngine On
# Removes index.php
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
# If 404s, "No Input File" or every URL returns the same thing
# make it /index.php?/$1 above (add the question mark)
</IfModule>
注意:我尝试将? 添加到规则中,但没有成功。
该站点位于虚拟主机的根目录。
【问题讨论】:
-
你能告诉我们你的.htaccess的代码吗?该网站是否安装在子文件夹中?
-
也许
RewriteBase /在这里建议:stackoverflow.com/questions/7084223/… ?
标签: .htaccess windows-7 wamp expressionengine