【问题标题】:Apache (.htaccess and mod_rewrite) url rewrite/redirection not working :404 page not found errorApache(.htaccess 和 mod_rewrite)url 重写/重定向不起作用:404 page not found 错误
【发布时间】:2014-07-14 22:18:21
【问题描述】:
我刚刚在我的服务器上安装了 mod_rewrite 模块,并试图通过将所有 url 指向网页 good.html 来测试它
这是我的 .htaccess 文件:
RewriteEngine on
RewriteRule .* good.html
但是我不断收到 404 页面未找到消息?
我检查了我的 httpd.conf 文件并运行了 phpinfo() 并且该模块似乎加载正常。有什么想法吗?
我也在研究 apache 2.0.58
【问题讨论】:
标签:
html
apache
mod-rewrite
url-rewriting
【解决方案1】:
我也遇到了同样的问题。一切看起来都很好,但我不得不更改 httpd.conf 上的两个配置(或加载的任何其他站点配置)。
改为:
Options FollowSymLinks
AllowOverride All
这些选项位于目录标签中。如果不设置 AllowOverride All,.htaccess 不会生效。
埃德