gpt4 book ai didi

.htaccess - localhost .htaccess 上的访问被拒绝

转载 作者:行者123 更新时间:2023-12-04 11:12:56 24 4
gpt4 key购买 nike

关闭。这个问题是off-topic .它目前不接受答案。












想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。

10年前关闭。




Improve this question




我有一个私有(private)部分,特定用户可以在我的系统上登录(限制为 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 看到我的站点。一切正常

为什么我设置限制时访问被拒绝?

最佳答案

您可以先拒绝然后允许:

order deny,allow

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

显然我无法使用您的设置进行测试,但这就是我所做的。

关于.htaccess - localhost .htaccess 上的访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9243925/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com