Forum Moderators: phranque

Message Too Old, No Replies

Testing .htaccess IP deny

How to test for successful allow,deny setup?

         

SubMaster

1:03 am on Mar 23, 2006 (gmt 0)

10+ Year Member



Hi folks--

Thanks for reading.

Basically, I'm looking for a way to test the configuration of the allow,deny portion of my .htaccess file. I've done the obvious (to me, anyway) searches and haven't come up with a way to test whether specific IPs are successfully denied. I don't have root access, and I have a mod_rewrite redriect in place that works.

Any pointers would be greatly appreciated.

Thanks,

S
^
M

lammert

2:33 am on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



SubMaster, first of all Welcome to WebmasterWorld!

The easiest way to test a deny in a .htaccess file is to add the IP of your own computer. If you can't access the site it works. In this setup I assume that you have the ability to remove your IP address from the .htaccess file via FTP, SSH or some other route, otherwise your site will be permanently inacessible for you.

Another method I use is to use a proxy server I know. I add the outgoing IP address of the proxy server in the deny list. I open an Internet Explorer browser connection via the proxy and a direct Firefox connection to the site. The site should be blocked in one browser, but at the same time accessible via the other.

SubMaster

2:29 pm on Mar 23, 2006 (gmt 0)

10+ Year Member



Of course! [forehead-smack]

I was so focused on some sort of software tool or testing website that I overlooked the simpler solution. Thanks!

I've got a sizable list of denied IPs in the .htaccess file -- is it safe to assume that if allow,deny works for one IP, it's working for all IPs in the list?

S
^
M