Banning Bots

Starting with an article at diveintomark: block spambots I decided to finally get rid of those unwanted visitors. I was a bit annoyed by a wave of referers from (I think) porn sites a few days ago.

This should also protect any contact addresses posted anywhere on my site at least while I keep the list uptodate.

Finally I am thinking about blocking google access to some pages to remove some of the google bombing factor of the blog. Either that or the sidebar must go from the entry archives. Bzw the miserable failure is nothing but a – very popular – google bomb.

Interesting links:
Evolt: Using Apache to Stop Robots
Robots Database

Sample .htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon
RewriteRule .* – [F,L]
RewriteCond %{HTTP_REFERER} ^http://www.freenudecelebrity.*
RewriteRule !^http://[^/.].your-site.com.* – [F]

mod_rewrite should be activated and the option FollowSymLinks should be set.