Fixing Referrer Spam in .htaccess Print

  • referrers, htaccess, spam, analytics
  • 75

Are your web analytics full of low quality referrals? If you made the mistake of signing up for a "free website traffic" service, it's likely you suffer from this. Your logs will be full of referrers like this:

best-seo-offer.com
free-social-buttons.com

Those are the obvious ones, but these "services" have used a wide range of deceptive names and they keep adding more. This is a problem because the "traffic" you see is just junk from bots. It doesn't represent real visitors, it just skews your actual traffic numbers, increases your bounce rate, and obscures what's really going on.

Fortunately, Abivia provides an easy fix: we scan for low quality referrers and set a flag if we find them. We also do the same for a variety of services that are designed to get your attention solely for the purpose of spamming you.

All you have to do to filter these referrers out is to add these lines to your .htacces file (close to the top is better, before redirects):

# "Webmaster lead acquisition" referrers
deny from env=pingl_bot
# Fake traffic (as pioneered by Semalt)
deny from env=semalt_bot

Activate those and the fake traffic will get a "403 Forbidden" error code and your statistics will be cleaner. This mechanism is never perfect, because new referrers keep popping up. If you find one, let us know and we'll look at adding it to our list.


Was this answer helpful?

« Back