Forum Moderators: phranque
subdomain.domain.com, or
subsubdomain.subdomain.domain.com
I tried the following without success:
RewriteCond %{HTTP_REFERER} ^http://(www\.).*domain.com.*$ [NC,OR]
But that rule is completely ignored. I did try this with both Options +FollowSymlinks on and off (commented out) to no avail.
Can you assist please?
Welcome to WebmasterWorld!
I assume you have a RewriteRule following that RewriteCond, and that the RewriteCond you show is not the last one in the ruleset:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://.*domain\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://otherbadsite\.com [NC]
RewriteRule .* - [F]
The requests from these sites will still show up if your logs, they'll just get a 403 response.
Jim
Yes indeed, the conditions you mention are actually in place. I was not aware however that even if they do get a 403 they will still be shown in the referrer log! I assumed that they won't, hence their attempt will not show up on my blog's referrers list, which was my intention all along...
I didn't however put the escape \ character before the dot. If that is necessary, then it is my error and it might have contributed to the problem.
The only way to really block this kind of stuff is to ask your host to block them by IP address at the firewall (or router). If the requests don't reach your server, they won't be logged.
Jim