Here is a sample code I'm using in .htaccess to block spam referers:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://.*buttons-for-your-website\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*free-social-buttons\.com/ [NC]
RewriteRule ^(.*)$ – [F,L]
Also, I have the following code in nginx configuration because I have nginx stands as a reverse proxy in front of apache:
if ($http_referer ~ "buttons-for-your-website\.com|free-social-buttons\.com")
{
return 403;
}
I'm still getting hits from buttons-for-your-website.com, by some way this bot can bypass all previous rules and I have no clue how. I've verified both htaccess rules and nginx configuration on a domain of mine and they blocked access to my website from that domain. So, how these bots are still able to visit my website? Appreicate your answers.
RewriteCondpattern is too specific, you only need a regex like:buttons-for-your-website\.com(like you have for nginx) or even justbuttons-for-your-website. – MrWhite Jun 01 '15 at 18:53