Website stuff: blocking referer spam via .htaccess

I’m sick of fake referers showing up on my traffic logs. My sites get thousands of hits from crap sites that only want to show up in my statistics, presumably on the hopes that I keep the logs in a directory that’s indexed by Google. (Which I soooo don’t.) Or maybe that I, myself, will be naive enough to click on one of the links in my stats and decide to become a client of their investment services / dubious medical products. Because after all, who wouldn’t trust such a reputable institution with their money?

So I want to block these little bastards through .htaccess. My host recommends the following code:


setenvifnocase Referer "^http://spamdomain.com" spam_ref=1 
&ltFilesMatch "(.*)"> 
Order Allow,Deny 
Allow from all 
Deny from env=spam_ref 
</FilesMatch>


However, this is from a kind of old knowledge base article, so I’m just wondering if any *NIX gurus on here can confirm that this will do the trick, or if there are any newer methods for getting rid of the junk? Thanks!