If you are a professional blogger then you would like to work in your blog whole the day. You do all the stuffs to launch your blog and get a better position in search engine. You do give best to boost your blog performance. But think about that if any body copies your hard works! Someone copies your articles, ideas and your blog theme too. That is not acceptable and you should block that person to visiting your site.
I found some methods to block some body by using the .HTACCESS file that has been described simply in the following.
How to block a particular person to visit your site
You can block the visitors from any location, country or continent defining the IP addresses in the .HTACCESS file. I’ve given some example to block the visitor in various way.
1. Block the visitor from an IP: To block a visitor from a particular IP address ad the following rules in your .htaccess file in the root directory of your server.
order allow,deny deny from xxx.xxx.xxx.xxx allow from all
Replace xxx.xxx.xxx.xxx with your desired IP address. But if you want to block the visitor who uses dynamic IP then the above rule would not sufficient. You have to define the range of IP address. Here defining the range need some advanced experience. For example, if you want to block the range 22.214.171.124 – 126.96.36.199 then you should put any one of the following rules:
Deny from 188.8.131.52/23 or Deny from 184.108.40.206/255.255.254.0
Here is some rules of defining a range
# For the range 220.127.116.11 - 18.104.22.168 Deny from 22.214.171.124/22 or Deny from 126.96.36.199/255.255.252.0 # For the range 188.8.131.52 - 184.108.40.206 Deny from 220.127.116.11/15
You can use the rules wisely to block a range of IP addresses.
2. Block the visitors from an ISP (Internet Service Provider): Some time blocking the IPs may not sufficient for you. If you want to disallow the visitor of a ISP then put the following line in your .HTACCESS file
order allow,deny Deny from ISP-Name.com allow from all
3. Block the visitors from a a country: Some time you may think about to ban the visitors from the whole country to visit your site. Manually you can ban the total IP ranges, used in that country. But there is an easy service that generates the code to be placed in your .HTACCESS file. Visit Block A Country. Com and just select the country from the list to ban for your website. After that press the button “GO”.
Immediately after that you will get the code that contains the rules of blocking all the IP addresses, used from that country.Copy the piece of code and paste it in your .HTACCESS file.
4. Block the visitors from a continent: If you want to deny the visitors of a continent then you can try this site and just select the continent you want to ban and click on the “.htaccess deny” cell corresponding to that continent.
Now copy the piece of code and paste it in your .HTACCESS file.
All the above procedures are related to edit your .HTACCESS file. So keep a backup of that before editing, so that you can restore the stable version if anything goes wrong.