Click to See Complete Forum and Search --> : Blocking IP's


Apollo03
07-17-2006, 09:01 AM
Can someone please let me know how I can block visitors to my website from... say... China?

Thanks!

LeeU
07-17-2006, 09:51 AM
Try this in your .htaccess file (borrowed from JavaScriptKit):

order allow,deny
deny from 123.45.6.7
deny from 012.34.5.
allow from all
The above blocks access to the site from 123.45.6.7, and from any sub domain under the IP block 012.34.5. (012.34.5.1, 012.34.5.2, 012.34.5.3, etc.).

You just need to find out the IP numbers for China. Just remember, you'll be blocking 1+ billion people. (Also check Google: "ip, blocking").

Apollo03
07-17-2006, 10:54 AM
Thank you very much!

We currently have no customers in China... but I believe out product is being knocked-off by Chinese manufacturers visiting our website (as shown in Google analytics) and then sold to our competitors (as seen on their website)... so I'm still considering this even though it would block over 1 billion people (not that all 1 billion have internet access anyways but still). Also I understand the competitor may be saving the pictures and sending it to the factory so that this may be futile.

Cheers

ray326
07-17-2006, 01:20 PM
You can't block geographic areas by IP address.