mac 下 apache2 配置 rewrite_mod 问题

已经在 /etc/apache2/httpd.conf 中

去掉了

LoadModule rewrite_module libexec/apache2/mod_rewrite.so 

前面的注释符号,phpinfo() 函数显示已加载 rewrite 模块

在 httpd.conf 文件末尾加入

RewriteEngine on
RewriteRule ^/t_(.*).html$ /test.php?id=$1

进行测试时 rewrite 不起作用, 出现 404 错误

输入地址为:
http://localhost/~gipanda/projects/t_test.html

错误显示:
The requested URL /~gipanda/projects/t_test.html was not found on this server.

请问这是为什呢。。?

阅读 8.4k
3 个回答

无意中看到的以前自己提的这个问题, 顺便贴下答案
需要在 .htaccess 或 apache 配置文件中添加
Options +FollowSymlinks

新手上路,请多包涵

放到当前项目文件夹下的.htaccess 文件中。

遇到同样的问题请问怎么解决的

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题