PDA

View Full Version : blocking certain IPs


uber2k
09-17-2007, 04:48 PM
Hi,
Ive been trying to block some IPs from accesing my site. I have the following at the beginning of my .htaccess:

Order Allow,Deny
Deny from xx.xx.xx.
Allow from all

But that range of IPs keeps accesing :confused:

areidmtm
09-17-2007, 05:14 PM
To deny a single IP address
deny from 10.0.0.1

To deny an IP range
deny from 10.0.0.1/8

I have never add Order Allow,Deny or Allow from all parts.

The /8 is the CIDR and it will block that entire c-class for that IP. It's usually /8 but to make sure do an IP whois look up and check the CIDR.

Replace the IP with the one you want to block to see it's CIDR
http://ws.arin.net/cgi-bin/whois.pl?queryinput=72.14.253.99

kgmac
09-17-2007, 05:38 PM
I hope you don't mind me tagging along on this thread. I came to post a question about blocking, but it's different.

Is there any way to block anonymous surfer sites? I'm guessing no, other than simply to enter all the domains and hope they're using a static IP.

Thanks in advance for any help.