QUOTE
It's not working. Paris was back this morning.
The one mistake a lot of people make is putting the IP address of the spam referral site in their .htaccess denials, rather than the IP address which planted it.
For example, denying the IP address of the Paris Hilton Sex Video (which has appeared in my referral logs too) won't have much effect, because that's not the IP address that's planting the spam there.
However, spotting the true IP address responsible for the spamming is quite easy. There's a few ways to do it.
1) If your web host/server uses Awstats to generate your stats, then consult your latest log file. Look at the list of "hosts", ie the IP addresses that have actually visited or pinged your web site. What you need to look out for is any visiting IP address that consumes 0 bytes of bandwidth. This just means they're pinging your HTTP header to generate the referral spam, rather than actually visiting a page.
2) Download your raw stats file and load it up in a decent text editor (preferably one that can display a full navigable list of search results, such as UltraEdit). Do a search for the string "HEAD. This will show you a list of IPs that have (almost) exclusively just pinged your HTTP header and it will show you the spoof referral they're generating. Be careful here, because a few legitimate sites (such as server statistic gatherers or indexers) can show up here. But more often than not it's a referral spammer.
3) Not all spam referrals exclusively punch the HEAD though. Some will actually GET your index page too. These can be a bit trickier to spot.
By way of an example, these are the search results of the "HEAD string within my blog site's latest referral log:
CODE
206.129.0.135 - - [14/Jan/2004:00:40:31 +0000] "HEAD / HTTP/1.0" 200 0 "http://www.riaa.com" "Referrer Advertising System"
I seem to get hit by referral spam for the RIAA whenever I post a new blog entry that mentions mp3s, digital downloading, or anything like that. 206.129.0.135 (NOT www.riaa.com) gets added to my denial list.
CODE
172.132.46.68 - - [15/Jan/2004:07:50:10 +0000] "HEAD / HTTP/1.1" 200 0 "http://www.starprose.com" "StarProse Referrer Advertising System 2004"
See -- it's so much easier when these referral spammers identify themselves so easily. 172.132.46.68 gets banned.
CODE
172.167.114.207 - - [26/Jan/2004:16:52:44 +0000] "HEAD / HTTP/1.1" 200 0 "http://www.joe2004.com" "StarProse Referrer Advertising System 2004"
172.167.114.207 - - [26/Jan/2004:21:17:20 +0000] "HEAD / HTTP/1.1" 200 0 "http://www.clark04.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Crazy Browser 1.0.5; Alexa Toolbar)"
WTF?! Presidential candidate spam. Oddly enough, the same IP address is responsible for referral spamming the official web sites for both democratic candidates.
I've only started doing this within the last month, seeing as I've only just recently launched a new blog, but these are the IP addresses I'm currently denying:
206.129.0.135
172.132.46.68
172.137.45.63
206.129.0.134
206.129.0.132
206.129.0.133
172.167.114.207
205.236.189.35
69.7.170.46
213.123.247.181
217.118.39.51
200.41.4.3
200.217.186.2
63.110.140.28
195.241.96.171
64.173.247.185
200.161.74.26
194.249.174.250
Another tip -- you might want to create a "friendly" 403 error page. This is what people are going to be seeing if they're in my deny list. Given that this blocking procedure is manual, there's always the risk a legitimate IP will end up in it, so you might want to use the 403 error page to briefly explain why they might have been denied and who to contact to resolve the issue.
Oh, and if your web site doesn't actually display a list of referrers, creating denial lists probably isn't worth bothering with. It's only bloating your .htaccess file, which EVERY incoming visitor is going to hit -- and 99.99% of those visits are from genuine visitors. Of course, if you're being hit dozens/hundreds/thousands of times a day by the same spam referrals, then you should add it. But if it's just a "casual" referral spammer who's visiting once every few days, it's probably not worth the effort.