开发者

limit visits to site

i need to limit visits to my site from some region开发者_如何学Cs. 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?)


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.


IP addresses; .htaccess won't help you here. CogitoErgoSum nails the geolocation of IPs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜