Search code examples
.htaccessmod-rewritehttp-refererreferrer-spam

blocking semalt referrers with htaccess rules


I have implemented the following code to htaccess but are still seeing referrers from semalt, such as:

74.semalt.com
89.semalt.com

The code:

# Block visits from semalt.com
RewriteEngine on 
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*semalt\.com [NC]
RewriteRule .* - [F]

Any idea how these referrers are bypassing this rule (which I found online) and how I can fully prevent them?


Solution

  • Ok, this is how I got it to work:

    # Block visits from semalt.com
    RewriteEngine on 
    RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*semalt\.com [NC]
    RewriteRule (.*) http://www.semalt.com [R=301,L]