Block Access By Referer

If you are receiving lots of SPAM from visitors referred from a specific domain, you may wish to utilize this function.

By blocking access by referer, you are making your website unavailable to anyone coming to your site from a specified domain. For example, if you are receiving tons of fake bot “hits” from a specific website which is eating up your server resources and bandwidth, you can insert the following code in your .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} botsite.com [NC,OR]
RewriteCond %{HTTP_REFERER} othersite.com [NC,OR]
RewriteRule .* – [F]
</ifModule>

Each domain is placed on its own line, and the domain name is substituted with those shown in the above example.