How to stop referrer spam.
This fix pertains to apache servers only. It requires modification to the .htaccess file which is in the root directory on the server. Always create a backup of the .htaccess file just in case.
Since htaccess starts with a dot it is hidden from view in Expression Web and FrontPage.
Put this in the .htaccess file, changing "spammersite" to the name of sites found spamming your logs. The first site listed should not have "NC", and the last one should not have "OR".
If your site starts generating errors after you upload this file, remove the # from the first line. If you use Microsoft FrontPage on your site, do not do this. Changing the .htaccess file could interfere with FrontPage.
# Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?spamsite1.com.*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?spamsite2.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?spamsite3.com.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?spamsite4.com.*$ [NC] RewriteRule .* - [F,L]
This will give the spam site a forbidden error. If you prefer, you can rewrite that last line as "RewriteRule \.*$ http://www.some-other-website.com [R,L]" to redirect them to whatever site you choose (be nice!). Either way, it keeps them out of your referrer logs and there is no way to defeat it.
OR = or next. In this case, this means choose one of the
RewriteCond rules rather than all of them. If the OR was left out,
ALL the RewriteCond rules would have to be true.
NC = no case (upper or lower case acceptable)
F = forbidden
L = last of the affected rules
R = redirect URL