Forum Moderators: phranque
I'm trying to forbid access to a domain along with all its subdomains using:
RewriteCond %{HTTP_HOST} ^(([a-z0-9\-]+\.)*somesite\.com)$ [NC]
RewriteRule ^(.*)$ [%1...] [R=301,L]
It should redirect the referer -some spammer- towards itself, but it does not work... No effect at all.
"back-references %N to the last matched RewriteCond pattern" says the Apache 2 documentation. Or did I misunderstood something?
Thanks for your help.
Your rewrite condition only needs to be comprehensive enough to be sufficiently exclusive.
This will forbid all links from a domain:
# begin .htaccess code
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} somesite
RewriteRule .* - [F,L]
# end .htaccess code
Is that what you're trying to do?