localhost .htacces上的访问被拒绝

Tre*_*ler 7 .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>
Run Code Online (Sandbox Code Playgroud)

但我得到这个错误:

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.
Run Code Online (Sandbox Code Playgroud)

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

如果我在本地访问我的网站,我可以看到我的网站使用mod-rewrite和errordocument.一切都很好

当我把限制时,为什么我会拒绝访问?

Jör*_*yer 10

你可以先否认然后允许:

order deny,allow

deny from all
allow from 127.0.0.1
allow from 192.168
allow from 67.xx.xx
# etc..
Run Code Online (Sandbox Code Playgroud)

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