View Full Version : Country IP Blocks
Thought this link would come in handy for someone
http://www.countryipblocks.net/index.php
handsonwebhosting
11-21-08, 10:09 PM
eeeeekkk... don't let my customers see it ;)
We had one guy with an .htaccess file that was almost 1MB in size and it pretty much crippled his site as he wanted to list all the IPs in the world that couldn't access his site, etc. What a nightmare.
Found it much easier to have him on a VPS and load up mod_geoip. Now he can just type in the name of the country he wants to show and it will do it.
edit .htaccess file
GeoIP ON
SetEnvIF GEOIP_COUNTRY_CODE CN BlockThese
SetEnvIF GEOIP_COUNTRY_CODE TR BlockThese
# Add more countries here
Deny from env=BlockThese
Maybe someone can use that one rather than IP ranges as the more lines you have in your .htaccess file the longer it takes to load the pages.
Don't forget, you MUST compile mod_geoip in Apache ;)
Deny from GEOIP_COUNTRY_CODE
dominic22
12-01-08, 07:30 PM
Nice, thanks. This will come in handy for people I know and possibly for me as well. :)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.