htaccess deny range of IPs

I was recently fired from my old job. It wasn’t a good firing – no reason behind it, and they’re being jackasses to me afterwards. So, 4 weeks later I notice that someone is still accessing my site, my personal help site, from one of their IP addresses. That can’t be. I can’t allow a company to fire me without a reason and then just let them use all of my work. Screw that.

So I did what anyone would do to prohibit these cretins from stealing my work:
edit the htaccess file to disallow their entire subnet.

SSH into your site
nano .htaccess – this will create the file if you don’t already have it
add the following:

order allow,deny
deny from 69.213.173.0/24
#deny from 69.213.173.144
allow from all
ErrorDocument 403 http://it.thelibrarie.com/errors/forbid.html

69.213.173.144 is their gateway (I should know, I only put in 4 years there). Last I checked it was a Sonicwall 4100 Pro, but they were trying to switch it out with a pair of Cisco ASA 5510’s. On a final note: Fuckers.

Leave a Reply

Your email address will not be published. Required fields are marked *