使用 htaccess 规则阻止 Semalt 引荐来源网址

2023-12-13

我已经在 htaccess 中实现了以下代码,但仍然看到来自 semalt 的引荐来源网址,例如:

74.semalt.com
89.semalt.com

代码:

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

知道这些引荐来源网址如何绕过此规则(我在网上找到的)以及如何完全阻止它们?


您的代码看起来不错,语法检查正常!我使用了这些 mod_rewrite 方法:

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]

或使用 .htaccess 模块 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

我什至创建了一个 Apache、Nginx 和 Varnish 黑名单以及 Google Analytics 分段来防止引荐垃圾邮件流量,您可以在这里找到它:

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 htaccess 规则阻止 Semalt 引荐来源网址 的相关文章

随机推荐