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.
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
This is very useful Nihar specially to block those spam comments and spam bots joining my blog…
Blogspot to wordpresss last blog post..MaxBlogpress Ping optimizer : WordPress must have plugin
@Harsh, Yeah you are right. I have blocked some nasty visitors in the past.
Good to see you on new theme.I have tried this method to block some spammers.
One more request why don’t you mobilize your website buddy.
@Ricky,
How do i do that? Will be happy to learn from you.
I actually was using a wpress plugin briefly that automatically added ip addresses of spambots to htaccess list. But soon the htaaccess file got really bloated. Stopped using that when I found a better antispam software.
@Pallab, Can i know which antispam software do you use?
I am using Wp-Spamfree ( http://www.pallab.net/2008/07/.....ment-spam/ ). I started using it when Akismet all of a sudden started letting dozens of spam through. Also manually going through 100+ spam messages to weed out genuine ones was getting impossible.
It blocks anyone who doesn’t have javascript on and none of the spambots are capable of deciphering js.
It brought my spam count down from 20-30 (with akismet and captcha) to 0 (without akismet or any other plugin).
Another similar solution is Raven’s Antispam. But that doesnt block aynone without js outright. Instead it creates an additional field that must be filled in.
http://kahi.cz/wordpress/ravens-antispam-plugin/
Pallabs last blog post..STDU Viewer – A Free PDF, DjVu and TIFF Reader
@Pallab, I am also using WP-Spamfree plugin from last 6-8 months.
Hi Nihar
I have a query. for a single post, u post it in 2-3 categories. Doesn’t google count it as Duplicate
Atuls last blog post..Sachin Tendulkar-GOD of Cricket
@Atul,
I dont’ think so. I have seen some blogs who does this. Have you read somewhere? let me know.
Hi Nihar
I’ve also seen bloggers doing this. I am not confirmed of this, so was asking u . As if we use translator plugin and submit translated pages to google, Google counts it as duplicate. So thought that posts in multiple cats might be counted as duplicates. If I get to know from any other source, I’ll definitely will let u know.
Atuls last blog post..Sachin Tendulkar-GOD of Cricket
@Atul, Even i heard and read in some blogs that translator plugin causes duplicates. Will wait for any information if you get.
As far as i know. I don’t think it is a problem.
Yes same posts from diff categories will be a duplicate.. Don’t allow search engines to crawl category pages…… that will solve the problem..
Samrat Ps last blog post..Create Online Presentations With Adobe
@Samrat P, Hmm. I need to then modify robot.txt to disallow indexing on category pages. Am i right?
yeah you can do that… But u might end up with many 404 errors.. So do take care of that also..
Samrat Ps last blog post..Windows Speech Recognition (WSR) Profile Tool for Windows 7 & Vista
Much needed information for me. Thanks a lot Nihar…I’ll try and ask you if any doubts.
TechZoomIns last blog post..Winsyntax: Simple & Free PHP Editor..!
@TechZoomIn, No problem Any time. i will be ready to help you.
does there any facility to block ip addresses like this for blogspot blogs .
venkats last blog post..Get TechSmith Snagit 7.25 absolutely FREE
@Venkat, I am not sure. Hey why don’t you get a domain and switch to wordpress. i did the same thing.
Nice trick Nihar but it can lead to your htaccess file getting a bit bloated so not recommended.
BTW check out my latest post for another anti-spam hack!
Donaces last blog post..Beware the smiling man
@Donace, I agree but, it will be bloated only if we have lots of ip’s. If we are blocking 5-10 ip’s then i don’t think it will be a problem.
The only problem with this approach is that sometimes when you block an IP on a shared host, the trackbacks from other potential blogs on that IP could get banned? I am not sure… Usually, there are 600 or 700 domains on a single IP of those shared hosting services.
And as Donace said, the htaccess file can really grow in no time…
Ajith Edasserys last blog post..Blog Statistics: What, when and where?
@Ajith, Agreed with you. If you know any other way by which we can block visitors do let me know.
Hi Nihar
Instead of this, I recommend any wordpress plugin like Aksimet, Wp-Spamfree etc. Me personally using Wp-Spamfree for my blog
Atuls last blog post..Sachin Tendulkar-GOD of Cricket
@Atul, This is for those who just wants to block very few visitors who are bad on them. Yes i am also using Wp-Spamfree from long time and it is very good plugin has blocked around 25000 comments till now
Hi Nihar
WP-Spamfree has blocked around 250 spams from my blog only 2 0′s less from that of urs
Atuls last blog post..Words Women Mostly Use
LOL… But i am using WP-Spam free from long time. Thats why i have 2 0′s more
I am thinking to take a domain and move to wordpress in future .
venkats last blog post..Subscribe to our Blog and get Freebies straight to your Inbox
@Venkat, Do that as soon as possible. WordPress gives lots of features and plus you have got thousands of plugins to be used. Also you have total control as you will be hosting it.
Hi Nihar
Make sure you backup .htaccess file before you making any changes.
for this line in red color box with cross mark, are u using any plugin for this
Atuls last blog post..Sachin Tendulkar-GOD of Cricket
@Atul, Thanks for asking this question. Its not a plugin. Its combination of CSS and images. I will come up with a post so that others can grab the images and the CSS Code
whatever it may be it looks good.. seems u are good in CSS too
Than you for this hack, I’ve been wondering how to block some spammers from one of my blogs
[...] How to avoid Hotlinking of file and images using .htaccess hack Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic.Yesterday, i posted a .htaccess hack to Block Visitors from specific IP using .htaccess [...]
This is a good way to stop spammers… But sometimes I love to read the spam comments.. bit funny!!
Samrat Ps last blog post..Create Online Presentations With Adobe
@Samrat P, You are right.
[...] How to Block Visitors from specific IP using .htaccess hack [...]
[...] How to Block Visitors from specific IP using .htaccess hack [...]
[...] Few days back, Atul from Ocean of Web left a comment at How to Block Visitors from specific IP using .htaccess hack. [...]
Good info ! Can use it as i am having trouble with some spammers recently.
@Neeraj, Great to see that this post helped you.
i am using wp-ban for same purpose plugin ,very simple to use plugin ….thanx for sharing your knowledge..
eeeeeeeetttttteeeeeeeeeelllllllll ggggggggggaaaaaaaaaarrrrrrriiiiiiiiiiinnnnnnnnnnnnnggggggggg