We found 0 resource for you...

Restricting access to your site with .htaccess

Being a server administrator, I am no stranger the “.htaccess” file.  In fact most web administrators/master should know what this files does.  Today’s issue however is not something an administrator would normally come across, in fact, I found NO documentation on this particular solution and had to come up with it on my own, using a few differed resources on the net.

Problem:

At work my department had an internal site which was accessible only from a certain IP address.  So having the following works great:

[code]AuthName "Internal Portal"
AuthUserFile "/var/www/internal/.htpasswd"
require valid-user
Order Deny,Allow
Deny from all
Allow from 192.168.1.100
Satisfy Any[/code]

However our firewall settings prevented the functionality I needed (the sites are on our gateway, which does not allow traffic to itself via the outside world, so some WordPress features just wouldn’t work) so I decided to put our site on our regular cPanel server.  …

Continue reading