localhost .htaccess上的访问被拒绝

时间:2012-02-11 20:46:48

标签: .htaccess

我有一个私人部分,特定用户可以在我的系统上登录(限制为4个用户)

我想使用以下方法在.htaccess中添加IP限制:

<Limit GET POST PUT>
order allow,deny
allow from 127.0.0.1
allow from 192.168
allow from 67.xx.xx
# etc..
deny from all
</Limit>

但是我收到了这个错误:

Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

当我尝试在本地访问此站点时(我的桌面上安装了指示灯,我的主机文件设置正确,我的apache配置也很好)

如果我在本地访问我的网站,我可以通过mod-rewrite和errordocument查看我的网站。一切都很好

为什么在我放置restrictin时我会拒绝访问?

1 个答案:

答案 0 :(得分:10)

你可以先否认然后允许:

order deny,allow

deny from all
allow from 127.0.0.1
allow from 192.168
allow from 67.xx.xx
# etc..

显然我无法测试您的设置,但这就是我的工作。