I would like to block visitors coming from certain domains and subdomains in my .htaccess file.
I have found following code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^.*(1234|asdf).* [NC]
RewriteRule .* - [F]
The problem is, I would like to block not only one domain as in "domain.tld" but also "subdomain.domain.tld" and all tld variants af this.
I take it the * in the code above does that?
Also I am not sure, if you have to put a \ before the . as?
The reason I ask is, I have read like 20 guides on that topic and every single one has a different code.
Thank you!
Well, one of the problem is, that not every Server 'handles' .htaccess
in exactly the same way, as it looks. Best is, to try, what's working...
Ernie
in exactly the same way, as it looks. Best is, to try, what's working...
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^somedomain\.com [NC] OR
RewriteCond %{HTTP_REFERER} ^subdomain\.somedomain\.com [NC]
RewriteRule .* - [F]
RewriteCond %{HTTP_REFERER} ^somedomain\.com [NC] OR
RewriteCond %{HTTP_REFERER} ^subdomain\.somedomain\.com [NC]
RewriteRule .* - [F]
Who is online
Users browsing this forum: No registered users and 74 guests