简体   繁体   English

使用.htaccess通配符阻止子域的垃圾邮件

[英]Block spam using .htaccess wildcard for subdomain

I have a lot of spam coming from one site with multiple subdomains and currently I am blocking them using individual lines as below 我有来自一个站点的大量垃圾邮件,这些站点具有多个子域,目前我正在使用以下各个行来阻止它们

RewriteCond %{HTTP_REFERER} site1.floating-share-buttons.com [NC,OR]
RewriteCond %{HTTP_REFERER} site2.floating-share-buttons.com [NC,OR]
RewriteCond %{HTTP_REFERER} site3.floating-share-buttons.com [NC,OR]
RewriteCond %{HTTP_REFERER} site4.floating-share-buttons.com [NC,OR]
RewriteCond %{HTTP_REFERER} site5.floating-share-buttons.com [NC,OR]

How can I use or what is the wildcard for the sub-domain part so I can achieve the same thing using just one line. 子域部分该如何使用或通配符是什么,以便仅使用一行就可以实现相同的目的。

Use regex alternation: 使用regex交替:

RewriteCond %{HTTP_REFERER} (site1|site2|site3|site4|site5)\.floating-share-buttons\.com [NC]

Or else if names are site1,site2,..site5 then: 否则,如果名称是site1,site2,..site5则:

RewriteCond %{HTTP_REFERER} site[1-5]\.floating-share-buttons\.com [NC]

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

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