Forum Moderators: phranque
I'm trying to ban sites by domain name, since there are recently lots of reference spammers.
I have, for example, the rule:
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*stuff.*\.com/.*$ [NC]
RewriteRule ^.*$ - [F,L]
which should ban any sites containing the word "stuff"
www.stuff.com
www.whatkindofstuff.com
www.some-other-stuff.com
and so on.
However, it is not working, so I am sure I did not setup a proper pattern match rule. Anyone care to advise?
[edited by: jatar_k at 5:06 am (utc) on May 20, 2003]
Is this what I need to add:
[code]
RewriteCond %{REQUEST_METHOD} ^(GET¦POST)$
RewriteCond %{HTTP_USER_AGENT} ^User_Agent_to_be_banned$ [NC]
RewriteRule .* includes/banned.html [L]
[/code]
Wiz
You (or your hosting service) may have another directive that is blocking POSTs, or maybe the server is set up to reject POSTs to html pages instead of cgi scripts.
Your thinking is correct - If you don't specify a method, mod_rewrite does not care about the method. It will treat all methods the same unless you tell it otherwise.
Look for a Limit or LimitExcept directive above the rewrite that is acting funny.
Jim
[edited by: Marcia at 11:25 pm (utc) on Oct. 13, 2003]