been having some trouble restricting access to this site by ip address using .htaccess.
the traditional method is to use a format like this:
order allow,deny
deny from 10.11.13.14
deny from 16.15.14.13
allow from all
this wouldn’t work for me at all. the only way i could make it have any effect was to comment out ‘allow from all’. this produced a 403 error for every attempted connect.
i contacted my hosting provider (laughing squid) as i couldn’t think of anything else to try.
after some troubleshooting it turns out that sites hosted in the cloud (at least the rackspace cloud’s environment) require a different method to ban by ip in .htaccess. more info can be found here.
so i added the following to my .htaccess file:
SetEnvIf X-Cluster-Client-Ip “^10\.11\.12\.13″ DenyAccess
Order Allow,Deny
Deny from env=DenyAccess
Allow from all
obviously replace the ip with the one you’d like to block. if you want to ban multiple ip addresses just repeat line one and alter it accordingly.
so thanks to laughing squid’s support team…quick response as always.