Referrer Spam

I was getting happier and happier with my rising hit counts, until I found that a large chunk of it was due to a bizarre new form of spam. Spammers are logging onto various blogs, this one included, using fake referral addresses. The sole aim, I think, is to get their website listed in your referral logs. For many people, including many time slices of me, this would be a complete waste of time, as I wouldn’t notice that all these links were coming in. Other bloggers read their referral logs and might follow these links. Others still post their latest referrals on their page (I used to do this) and that might mean the spammers end up with a prominent link. For all I know there’s a PageRank connection to this too. In any case it’s a nuisance. Fortunately a bit of Googling showed me how to stop it. If this is affecting you, you need to add code something like this to your .htaccess file.

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://*.web4u.gb.com$ [OR]
RewriteCond %{HTTP_REFERER} ^http://*.uaeecommerce.com/$ [OR]
RewriteCond %{HTTP_REFERER} ^http://www.popwow.com/$ [OR]
RewriteCond %{HTTP_REFERER} ^http://www.mediavisor.com/$ [OR]
RewriteCond %{HTTP_REFERER} ^http://www.oiline.com/$ [OR]
RewriteCond %{HTTP_REFERER} ^http://www.thatwhichis.com/$ [OR]
RewriteCond %{HTTP_REFERER} ^http://www.911easymoney.com/$ [NC]
RewriteRule .* – [F,L]

(Note those are all real spammers.)

I’m not sure whether this will work for all servers – you need to be running the right kind of Apache server or some such and I don’t understand the technical details. And it will cut your hits down, perhaps dramatically. (The effect is to send a ‘page forbidden error’ to anyone coming from those sites, which doesn’t count towards your hits.) But it’s worth it to (i) cut down on wasted bandwidth, (ii) stop the spammers and (iii) restore some value to incoming links. For instance today I found I have a nice link from The Chronicle of Higher Education which is pleasing.

Thanks for Virulent Memes for first alerting me to this problem.