I get 6-10 sign ups from places like Nigeria and Ghana in Africa. I'm currently capturing IPs so is it possible to restrict a range of IPs from a specific country?
If I can retrict them does it make more sense to add this range to my .htaccess file or restrict them at the site level?
Source: Tips4all
You can get the maxmind database:
ReplyDeletehttp://www.maxmind.com/app/mod_geoip
and use this code:
GeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat
# Redirect multiple countries to a single page
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(NI|GH)$
RewriteRule ^(.*)$ - [F]
Yes, you can. Use GEOIP. http://www.maxmind.com/app/php
ReplyDeletehttp://www.maxmind.com/app/mod_geoip
Just google for GEOIP - there's a number of free services available you can also get a file, containing Country specific IP patterns. No services will give you 100% protection as it's possible to forge the IP.
ReplyDeleteUsing Apache's mod_geoip:
ReplyDeleteGeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat
SetEnvIf GEOIP_COUNTRY_CODE US BlockCountry
# ... place more countries here
Deny from env=BlockCountry