How to block countries – IP htaccess method

by Lepki on December 23, 2009

On some websites, traffic from a particular country may be a bit annoying.

Open up your .htaccess file and visit one of the following websites:

http://www.blockacountry.com/

http://www.countryipblocks.net/

Sample code

ErrorDocument 403 http://www.where-to-re-direct-to.com
<Limit GET HEAD POST>
order allow,deny
deny from 62.5.128.0/17
deny from 62
...
..
.
allow from all
</LIMIT>

Redirect to another website, affiliate link or to a sample deny page!

More information on IP blocking

http://en.wikipedia.org/wiki/IP_blocking

Leave a Comment

Previous post: Super Thesis Tips

Next post: Testing password protection

Get Adobe Flash playerPlugin by wpburn.com wordpress themes