blocking semalt referrers with htaccess rules

前端 未结 5 1662
鱼传尺愫
鱼传尺愫 2021-01-03 11:22

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

5条回答
  •  星月不相逢
    2021-01-03 11:58

    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]
    

提交回复
热议问题