Block IP/ISP?


I was wondering if there is any way to block the access from certain ISP. I found the way to do it for IP but not for ISP.

Is it like… If I change IP to ISP in .htaccess, would that work?

order allow,deny allow from all deny from *.com

Like that? (Of course I won’t block the entire .com :stuck_out_tongue: )


That is one way of doing it, but ISPs are assigned blocks of IP addresses. So you can also find the block of IP addresses and block it instead…

You get the range of addresses using by searching on a given IP address. Look for the CIDR field, then copy it to your .htaccess like so:


deny from
----------------------[/code]This would eliminate the web server having to perform a DNS lookup to get the domain name, but would fail if the party you are trying to block switches to a different net block.

:cool: Perl / MySQL / HTML+CSS