.htaccess允许/拒绝ip使用require apache 2.4 [英] .htaccess allow/deny ip using require apache 2.4
问题描述
我的托管服务提供商最近将服务器更新为Apache 2.4,并且使用以下代码控制通过.htacces文件访问特定文件夹的规则不再起作用:
My hosting provider recently updated the server to Apache 2.4 and the rules to control access to a specific folder via .htacces file doesn't work anymore with this code:
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文档后,我知道我应该改用这样的东西:
After reading Apache 2.4 documentation I understand i should use something like this instead:
<RequireAny>
Require ip 123.123.123.123
Require ip 123.123.123.123
Require ip 123.123.123.123
</RequireAny>
,但是它不起作用。谁能帮助我解决这个问题?谢谢!
but it doesn't work. Any one who can help me figuring this out? Thank you!
推荐答案
对于2.4,现在看起来像这样:
For 2.4 it now looks something like this:
<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用户至关重要的信息。
A document describing information critical to existing Apache HTTP Server users.
https://httpd.apache.org/docs/trunk/upgrading.html
这篇关于.htaccess允许/拒绝ip使用require apache 2.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!