简体   繁体   English

.htaccess用通配符正则表达式阻止塞马尔特

[英].htaccess block semalt with wildcard regex

I have the below rewrite rule to block semalt.com. 我具有以下重写规则以阻止semalt.com。 It blocks all traffic referred by them (ie 1.semalt.com). 它阻止了他们引用的所有流量(即1.semalt.com)。 Recently they create a new referrer url (semaltmedia.com). 最近,他们创建了一个新的引荐来源网址(semaltmedia.com)。 How can I modify the below code to block if they have a word before or after the word semalt with no space or period (ie semaltmedia.com)? 如果他们在semalt单词之前或之后没有空格或句点(例如semaltmedia.com),我如何修改以下代码以阻止?

 RewriteCond %{HTTP_REFERER} semalt\.com [NC]

Try : 尝试:

RewriteCond %{HTTP_REFERER} ^https?://(www\.)?.*semalt.*\.com [NC]
RewriteRule ^ - [F,L]

This returns a forbidden (403) message for a http referer of the following formats : 对于以下格式的http引用,这将返回一条禁止(403)消息:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM