PDA

View Full Version : Prevent certain countries from accessing our website



AuctionHugh
06-06-2007, 08:59 AM
Every day my hit tracker shows hits to our web design company site from India because we have a high google ranking.

Then later in the day, I get phone calls bugging me to use their outsourcing services, which I have no desire to do.

Is it possible to set up our site, perhaps with an .htaccess file, so that no one from the country of india can access it?

Nothing personal against india, but I'm tired of being hassled by these phone calls.

Thanks.

(Mods, if this thread is in the wrong place, I'd appreciate it if you would move it to a more appropriate forum section. Thanks).

hostBrain
06-08-2007, 12:18 AM
Sure, with the trusty htaccess file, put the following code

order allow,deny
deny from xxx.xx.xxx.x
allow from all
Or if you want to block a block... :)

order allow,deny
deny from xxx.xx.xxx.
allow from all
This would block
xxx.xx.xxx.1
xxx.xx.xxx.2
xxx.xx.xxx.3
and on and on...

Eskhosting
06-27-2007, 07:54 AM
also with cPanel there is IP deny manager that will help you to block specific IPs, but in .htaccess it is also possible

AuctionHugh
07-05-2007, 09:30 AM
Excellent.

I can see from my statcounter logs that hits from india so far have come from 59.* 102.* and 203.*

Is there a place I can lookup to find out if I block those, if I will also be blocking north america IPs (since I'm using such a broad wildcard)?

Thanks!

AuctionHugh
07-05-2007, 08:54 PM
Here is what I came up with with a little help from my friends at webhostingtalk.com:

Blocking IP addresses in .htaccess for whole countries - WebHostingTalk Forums (http://www.webhostingtalk.com/showthread.php?t=618004)