Welcome to WebmasterWorld Guest from

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

How do I block China traffic?

china traffic

10:35 pm on Jul 2, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 3, 2005
votes: 0

How do I use javascript or html in my header pages to become invisible to China traffic?
2:06 pm on July 3, 2007 (gmt 0)

Full Member

10+ Year Member

joined:Aug 9, 2004
posts: 240
votes: 0

There are probably neater ways to do it but you can block China IP-ranges in your .htaccess file. The problem is that you have to keep the list of blocked IP-ranges updated, and it might not be possible to block ALL traffic from China since that would be too many IP-ranges.

If it is SPAM you are concerned about try blocking the ranges the SPAM originates from.

4:26 pm on July 7, 2007 (gmt 0)

New User

5+ Year Member

joined:June 7, 2007
votes: 0

.htaccess will do the trick right enough if you're on an Apache server. However, there's always more than one way to crack a nut.

If I wanted to see your content and my IP was blocked, the quick fix would be to look at your pages in the Google cache. You could, of course, try and get around that one by instructing Google not to cache your site by adding this tag to you pages:


I could also try a proxy server located outside China (that's assuming the great firewall of China doesn't manage to block proxies - maybe it does).

I think ultimately my point is what you want to do is most likely impossible, or at the very least incredibly difficult. For every tactic that thwarts the Chinese visitors, there is probably a way around it.

The only sure fire way to hide anything on the web is not to publish it.