问题
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
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!
回答1:
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>
EDIT:
Require ip 123.123.123.123
Require ip 123.123.123.123
A document describing information critical to existing Apache HTTP Server users.
https://httpd.apache.org/docs/trunk/upgrading.html
来源:https://stackoverflow.com/questions/37865658/htaccess-allow-deny-ip-using-require-apache-2-4