blocking websites

by thetoolsmith05 - 4/2/12 6:25 AM

In Reply to: blocking a website in certain country by VikeshU

I run a dating site similar to plenty of fish and faced the same issue. Here are a few options:

You can modify your .htaccess file to exclude certain countries like so:

<IfModule mod_geoip.c>
GeoIPEnable On
GeoIPDBFile /home/user/GeoIP.dat
SetEnvIf GEOIP_COUNTRY_CODE US AllowCountry
SetEnvIf GEOIP_COUNTRY_CODE CA AllowCountry
Deny from all
Allow from env=AllowCountry
</IfModule>

It's not the ideal solution.

Another option is to use a GEOIP service and block the IP based on it's origin using a service like: http://www.maxmind.com/app/country

Hope that sheds some light,
-Paul

Note: This post was edited by a forum moderator to remove unnecessary link to site on 04/02/2012 at 11:22 AM PT