简体   繁体   中英

Block spam referer and subdomains from htaccess

I'm blocking spam referer with this code. This works for simple-share-buttons.com, the problem is that I'm still receiving visits from sites like site22.simple-share-buttons.com. Is there any way I can block also the subdomain rather than adding them all in htaccess?

RewriteCond %{HTTP_REFERER} simple-share-buttons\.com [NC]
RewriteRule .* - [F]

You can try the following method

RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*simple-share-buttons\.com [NC]
RewriteRule .* - [F]

or

RewriteCond %{HTTP_REFERER} site22.simple-share-buttons.com [NC]
RewriteRule .* - [F]

if you still having traffic from specific domain. it is using your Google Analytics Code to recreate fake information and sending that directly to Google Analytics.

So you cannot do anything with {HTTP_REFERER} to stop it.

You can see more information about this subject here and how to solve it.

thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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