IP blocking disables basic authentication
-
Hello!
I’m trying to protect an URL with basic authentication, but it’s not working at all when IP-blocks like these is in the htaccess:
# Quick ban IP. Will be updated on next formal rules save. SetEnvIF REMOTE_ADDR "^###\.###\.###\.###$" DenyAccess SetEnvIF X-FORWARDED-FOR "^###\.###\.###\.###$" DenyAccess SetEnvIF X-CLUSTER-CLIENT-IP "^###\.###\.###\.###$" DenyAccess <IfModule mod_authz_core.c> <RequireAll> Require all granted Require not env DenyAccess Require not ip ###.###.###.### </RequireAll> </IfModule> <IfModule !mod_authz_core.c> Order allow,deny Deny from env=DenyAccess Deny from ###.###.###.### Allow from all </IfModule> # END iThemes Security - Do not modify or remove this lineWithout them the script below works:
SetEnvIfNoCase Request_URI "^/protected/url" SECURED AuthType Basic AuthName "Login" AuthUserFile /path/to/.htpasswd Require valid-user Order allow,deny Allow from env=!SECURED Satisfy anyAny idea on how to get the basic authentication to work along with the IP bans?
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
The topic ‘IP blocking disables basic authentication’ is closed to new replies.