Argh! Save Me from Spam!

This is a call to all mod_rewrite gurus out there… My Textpattern referrer logs are absolutely choked with spam referrals – 42 pages worth! It seems that my mod_rewrite rules in my .htaccess just aren’t working.

For example, I want to block Google Images, including all “local” versions (such as .co.uk, .de, etc). So I have this in my .htaccess file:

RewriteCond %{HTTP_REFERER} ^http://images.google.*$
RewriteRule .* - [F,L]

Unfortunately, this isn’t working. On the first page of my logs I count a dozen or so references to various Google Images sites.

I have a heap of RewriteCond rules that follow a similar pattern – just replace http://images.google with another domain. Some of these appear to work. Others don’t. I just can’t fathom it.

In addition, I tried to setup a more general keyword based rule, where I could just add whatever keyword was spammer flavour of the month and it would be blocked. Below is an example:

RewriteCond %{HTTP_REFERER} .*(lots|of|spam|keywords|here).*$

Again, this isn’t working…

My full list of anti-spam rules can be found in this text file (caution – lots of rude words within!). Could someone please help me debug it? I’m going out’ve my mind trying to figure it out!

%d bloggers like this: