i need to limit visits to my site from some regions.
how can i don't allow to visit my site from some country?(from Armenia for example)
(what is the way i must go? .htaccess
? or maybe only by ip
addresses?)
views:
35answers:
2
+3
A:
You can utilize geolocation. http://www.geoplugin.com/webservices/php has a solid API which will give you a good set of information on a region based on the visitors IP address. Using this you can log access to a database and cut off regions after X amount of visitors or compare against a blacklist in a Database.
Be aware, proxying users may be inadvertantly blocked (I.e. China user routes via Armenia. Or US user through Turkey etc).
Additionally this works in reverse, if someone truly wants to visit your site they can proxy around.
CogitoErgoSum
2010-08-17 14:56:16
A:
IP addresses; .htaccess won't help you here. CogitoErgoSum nails the geolocation of IPs.
Dean J
2010-08-17 14:58:23
Thanks for credit :)
CogitoErgoSum
2010-08-17 15:12:09