If you have a website which is just relevant for few countries only and you don’t want any unwanted traffic from other countries or you are spammed or attacked regularly from visitors from any country and want to block traffic from that country then you can modify your .htaccess file and block users from those countries.
Lets use service of a sited named www.blockacountry.com
- Select one or more country you want to block on home page of www.blockacountry.com and press Go button
- Now on next screen you can see set of command, copy it and paste it to your .htaccess file, in case if you don’t have it in ftp then kindly talk to your host or create one using notepad or another text editor. This code having set of IP from countries you selected and it simply reject visitors request from those countries.
Upload that .htaccess file into root of your domain using a ftp client. Every time when a visitor request your site from server it look into .htaccess file and if IP address of that visitor fall with in range of all denied IPs of your .htaccess then it will simply deny visitor request.
No comments:
Post a Comment