Journal »

Block Bad/Spam Referrers in HTACCESS

Gotta catch ’em all!

If you’re like everybody else managing a website online, you’ve dealt with the annoyance of getting into your site analytics to check out your traffic only to find that it’s filled with a bunch of spammy, junk websites as your top referrers. While you can certainly set up filtering within the analytics interface itself, it’s always better to gut them at the root. For more background on what referrer spam is, check out this article by DMJ Computer Services.

This spammer/bad host referrer list, initially compiled by developers in this Reddit thread by user printerwoes is a fantastic starting point. I plan to keep this up-to-date in the future as others (expectedly) pop up as well.

If you’re running on Apache, add this at the end of your .htaccess file, found in the root directory of your website:

Last updated June 5, 2015.

# BEGIN Spam Referrers
SetEnvIfNoCase Referer semalt.com spambot=yes
SetEnvIfNoCase Referer buttons-for-website.com spambot=yes
SetEnvIfNoCase Referer darodar.com spambot=yes
SetEnvIfNoCase Referer 7makemoneyonline.com spambot=yes
SetEnvIfNoCase Referer ilovevitaly.co spambot=yes
SetEnvIfNoCase Referer myftpupload.com spambot=yes
SetEnvIfNoCase Referer econom.co spambot=yes
SetEnvIfNoCase Referer iskalko.ru spambot=yes
SetEnvIfNoCase Referer ilovevitaly.ru spambot=yes
SetEnvIfNoCase Referer ilovevitaly.com spambot=yes
SetEnvIfNoCase Referer o-o-8-o-o.ru spambot=yes
SetEnvIfNoCase Referer o-o-6-o-o.ru spambot=yes
SetEnvIfNoCase Referer cenoval.ru spambot=yes
SetEnvIfNoCase Referer priceg.com spambot=yes
SetEnvIfNoCase Referer cenokos.ru spambot=yes
SetEnvIfNoCase Referer seoexperimenty.ru spambot=yes
SetEnvIfNoCase Referer gobongo.info spambot=yes
SetEnvIfNoCase Referer vodkoved.ru spambot=yes
SetEnvIfNoCase Referer adcash.com spambot=yes
SetEnvIfNoCase Referer websocial.me spambot=yes
SetEnvIfNoCase Referer cityadspix.com spambot=yes
SetEnvIfNoCase Referer luxup.ru spambot=yes
SetEnvIfNoCase Referer ykecwqlixx.ru spambot=yes
SetEnvIfNoCase Referer superiends.org spambot=yes
SetEnvIfNoCase Referer slftsdybbg.ru spambot=yes
SetEnvIfNoCase Referer edakgfvwql.ru spambot=yes
SetEnvIfNoCase Referer socialseet.ru spambot=yes
SetEnvIfNoCase Referer screentoolkit.com spambot=yes
SetEnvIfNoCase Referer savetubevideo.com spambot=yes
SetEnvIfNoCase Referer blackhatworth.com spambot=yes
SetEnvIfNoCase Referer prlog.ru spambot=yes
SetEnvIfNoCase Referer seoanalyses.com spambot=yes
SetEnvIfNoCase Referer forex-ninjas.com spambot=yes
SetEnvIfNoCase Referer bestwebsitesawards.com spambot=yes
SetEnvIfNoCase Referer o-o-6-o-o.com spambot=yes
SetEnvIfNoCase Referer humanorightswatch.org spambot=yes
SetEnvIfNoCase Referer aliexpress.com spambot=yes
SetEnvIfNoCase Referer 4webmasters.org spambot=yes
SetEnvIfNoCase Referer simple-share-buttons.com spambot=yes
SetEnvIfNoCase Referer best-seo-solution.com spambot=yes
SetEnvIfNoCase Referer best-seo-offer.com spambot=yes
SetEnvIfNoCase Referer Get-Free-Traffic-Now.com spambot=yes
SetEnvIfNoCase Referer sanjosestartups.com spambot=yes
Order allow,deny
Allow from all
Deny from env=spambot
# END Spam Referrers

That’s it! A powerfully easy way to stop them in their tracks.

For those interested, note the necessary misspelling of “referrer” in this rule.


One comment on “Block Bad/Spam Referrers in HTACCESS


Leave a Reply

Your email address will not be published. Required fields are marked *