我的托管提供商最近将服务器更新为 Apache 2.4,通过 .htacces 文件控制对特定文件夹的访问的规则不再适用于此代码:
Order Deny,Allow
Deny from All
Allow from 123.123.123.123
Allow from 123.123.123.123
Allow from 123.123.123.123
阅读 Apache 2.4 文档后我明白我应该使用这样的东西:
<RequireAny>
Require ip 123.123.123.123
Require ip 123.123.123.123
Require ip 123.123.123.123
</RequireAny>
但它不起作用。谁能帮我解决这个问题?谢谢!
最佳答案
对于 2.4,它现在看起来像这样:
<RequireAll>
Require all denied
Require ip 123.123.123.123
Require ip 123.123.123.123
Require ip 123.123.123.123
</RequireAll>
编辑:
Require ip 123.123.123.123
Require ip 123.123.123.123
描述对现有 Apache HTTP Server 用户至关重要的信息的文档。
关于.htaccess 允许/拒绝 ip 使用 require apache 2.4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37865658/