I am sure most of the Website owners or Blog owners have faced this problem. Some visitor is nasty or jealous and wants to trouble by posting abusive comments or do harm to the website.
One of the solutions is to Block or Deny the access to your Blog or website.
Yes, you can block a Visitor of your website. Read on to know how to do that….
Block Visitor from Specific IP Address using .htaccess Hack
I am assuming that you know about .htaccess file. It resides in the root directory of your website. The root directory could be /www/, /httpdocs/ or /public_html/ directories. Any of them depends on the hosting service.
Make sure you backup .htaccess file before you making any changes.
- Grab the IP Address of that visitor by checking your favourite Stats webservice. I use StatCounter to get the IP Address or Wordpress Dashboard (if the visitor has left a comment).
- Login to your hosting service site and open code>.htaccess file. Make sure you backup the file before making any changes.
- Lets say i want to block a Visitor coming from this IP Address 120.120.120.120. I will add the below entry in .htaccess at the end of the file.
deny from 120.120.120.120
- Now save the file
If you want to block more visitors, just keep adding the ip addresses in .htaccess file .
In this way, you can also block the automated spammer.
If you know any other way, please share via comments. Hope you learned something from this post!
Technorati Tags: block visitor, .htaccess hack




Subscribe