0

I saw that my website is receiving spam traffic from floating-share-buttons.com, Get-Free-Traffic.com, event-tracking.com, forum.topic64300434.darodar.com, etc. automatically. I searched on google and found a way to block this using htaccess file. The code I found is below -

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly.\.ru/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly\.org/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly\.info/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*iloveitaly\.ru/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*econom\.co/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*savetubevideo\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*kambasoft\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*buttons\-for\-website\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*semalt\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*floating\-share\-buttons\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*Get\-Free\-Traffic\-Now\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*event\-tracking\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*darodar\.com/ [NC]
RewriteRule ^(.*)$ – [F,L]

I want to know whether this code is best solution or not. The author of this code was saying that this code will block the spam traffic. I want to know whether it will or not? Is there any better solution? And what actually this code does with the spam bots?

Rohit Kumar
  • 2,048
  • 1
  • 14
  • 28

1 Answers1

1

No, it isn't the solution, that code won't work for most of the referrals on that list. The only ones that will be blocked using the htaccess file are semalt and buttons-for-website for the rest it won't have any effect.

We can split the spam in Google Analytics in 2 categories the Ghosts that only hit Google Analytics reports and never accesses your site and the Crawlers that as the name implies crawl your site therefore they do access.

Since Ghost spam doesn't interact with your website at all any server-side solution like the htaccess won't have any effect. To stop Ghosts you must use filters in GA

You can find detailed information in this related questions.

https://stackoverflow.com/a/28354319/3197362

https://stackoverflow.com/a/31270950/3197362

Community
  • 1
  • 1
Carlos Escalera Alonso
  • 2,333
  • 2
  • 25
  • 37
  • the content you provide about Ghosts and Crawlers was helpful. But I took the chance and added the code in my `.htaccess` file, and **from that time to a few days only** I was not able to see any referral traffic from floating-share-buttons, etc. in my GA. How can this happen? Might be they would be crawlers and not Ghosts.. But now since 1 week I'm seeing again huge amount of the referral traffic from those domains.. – Rohit Kumar Jul 19 '15 at 09:47
  • Ghost spam is not constant, they usually show up for a few days and then disappear, some of them come back or change the name. This behavior makes people think that the htaccess rule worked and then they get surprised when they see it again. So it is just a coincidence. You can see a list of all the spam in one of the articles of those answers, you can see all the Crawlers there. – Carlos Escalera Alonso Jul 20 '15 at 14:26