How to Block Spam Referrers like darodar.com from Accessing Website?

前端 未结 14 2465
北海茫月
北海茫月 2020-11-22 16:22

I have several websites that get daily around 5% of visits from spam referrers. There is one strange things I noticed about this referrers: they show in Google Analytics, bu

14条回答
  •  清歌不尽
    2020-11-22 17:02

    I used these mod_rewrite methods for semalt:

    RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?semalt\.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} ^http(s)?://(.*\.)?semalt\.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*semalt\.com\ [NC,OR]
    

    or with the .htaccess module mod_setenvif

    SetEnvIfNoCase Referer semalt.com spambot=yes
    SetEnvIfNoCase REMOTE_ADDR "217\.23\.11\.15" spambot=yes
    SetEnvIfNoCase REMOTE_ADDR "217\.23\.7\.144" spambot=yes
    
    Order allow,deny
    Allow from all
    Deny from env=spambot
    

    I even created an Apache, Nginx & Varnish blacklist plus Google Analytics segment to prevent referrer spam traffic, you can find it here:

    https://github.com/Stevie-Ray/referrer-spam-blocker/

提交回复
热议问题