Forum Moderators: phranque
The format of the referrer that I wish to ban is
keyword1-keyword2.blogspot.com
( the format is keyword1 followed by a hypen the keyword2 followed by ".blogspot.com".)
I tried the following in my mod_rewrite enabled .htaccess without success:
1)
RewriteCond %{HTTP_REFERER} ^http://(www\.)?([a-z0-9\-]+)\.blogspot\.com(/)? [NC]
2)
RewriteCond %{HTTP_REFERER} ^http://.*blogspot\.com [NC,OR] The rule is: RewriteRule .* - [F,L]
Is there an alternate format for banning blogspot domains beside those listed above beside IP banning?
I don't wish to change my website and let these spammers win!
As was noted in the previous thread, you can return a 403-Forbidden response to these requests, but you cannot "disconnect" them completely from your server unless you use a firewall configured to do so.
The proper form for the code would be:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://.*blogspot\.com [NC]
RewriteRule .* - [F]
If you have created a custom 403 error document, then that page will need to be excluded from the above rewrite. For example, if you called it 403.html, then you could exclude it by changing the rule to
RewriteRule !^403\.html$ - [F] If that code setup does not return a 403-Forbidden response to requests referred by bl0gsp0t, then you have some other problem preventing mod_rewrite from working.
Jim