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?