How to Block Unwanted Person to Visit Your Blog

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.

Related: Install and Control Multiple Sites in WordPress 3.0.

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 101.123.12.0 – 101.123.13.255 then you should put any one of the following rules:

Deny from 101.123.12.0/23
or
Deny from 101.123.12.0/255.255.254.0

Here is some rules of defining a range

# For the range 101.123.12.0 - 101.123.15.255
Deny from 101.123.12.0/22
or
Deny from 101.123.12.0/255.255.252.0

# For the range 101.123.0.0 - 101.123.255.255
Deny from 101.123.0.0/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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>