【发布时间】:2011-08-09 20:55:53
【问题描述】:
我有一个 mod_rewrite 我想在我的 Mac 上本地使用,但是当我将配置更改为在我的目录标签中时,我收到 403 Forbidden 错误。我已经尝试了所有其他解决方案,但没有运气。
也许有人会看到我没有的东西......
代码如下:
httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "/Library/WebServer/Documents/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
被 myusername.conf 覆盖
<Directory /Users/adrianmaurer/Sites/www>
Options Indexes MultiViews FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
虚拟主机文件 httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot /Library/WebServer/Documents
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /Users/adrianmaurer/Sites/www
ServerName myserver.dev
</VirtualHost>
【问题讨论】:
-
我遇到了同样的问题。如果我在“/etc/apache2/users/username.conf”中将 AllowOverride 设置为 All,我会开始在我的网站上为该用户收到 403 禁止错误。如果我将其设置回无,错误就会消失。
-
回到使用 nginx 但我很高兴你找到了解决方案
标签: apache configuration