Skip to content

Referrer Block 'em All

What's the problem?

Summarizing, false referrers can lower your website's placement in Google. You can find more detailed informations at the following link: http://en.wikipedia.org/wiki/Referer_spam

Since it's plenty of information about this argument on the internet I'm not going to tell you what this phoenomenon is, I will only provide an Apache Tomcat oriented solution, since it's quite difficult to find it on the web, and I'm going to summarize everything that I found in my hours of researches.

Apache Tomcat

The solution for Apache Tomcat that I used is to set up http://tuckey.org/urlrewrite/ library and add a custom rewrite rule.

I will mantain this rule for my project IntersectCMS, but feel free to use it, and if you have any addition please send me the other websites. I'm trying to add all the 8,000+ websites listed here http://perishablepress.com/blacklist/ultimate-referrer-blacklist.txt but it's a rather long work to see that everything is in the correct place, so please be patient.

The RULE

<rule>
<note>
This rule blocks most common spam sites. This list is continuously growing, to support please see the public repository.
The list is also being updated with the contents taken from http://perishablepress.com/blacklist/ultimate-referrer-blacklist.txt
</note>
<name>Block spam 1</name>
<condition name="referer" operator="equal" next="or">.*(?:(?:217\.23\.11\.15)|(?:217\.23\.8\.14)|(?:78\.110\.60\.230)).*</condition>
<condition name="referer" operator="equal" next="or">.*bestwebsitesaward\.com</condition>
<condition name="referer" operator="equal" next="or">.*semalt\.com</condition>
<condition name="referer" operator="equal" next="or">.*buttons-for-website\.com</condition>
<condition name="referer" operator="equal" next="or">.*cenoval\.ru</condition>
<condition name="referer" operator="equal" next="or">.*darodar\.com</condition>
<condition name="referer" operator="equal" next="or">.*hulfingtonpost\.com</condition>
<condition name="referer" operator="equal" next="or">.*anticrawler\.com</condition>
<condition name="referer" operator="equal" next="or">.*sharebutton\.net</condition>
<condition name="referer" operator="equal" next="or">(.*ilovevitaly\.(?:com|co|ru).*)</condition>
<from>^(.*)</from>
<set type="status">403</set>
<to>null</to>
</rule>

Flash