0
votes

I really can't find a solution, can someone pleas tell me how to block the following specific user agent exactly via isapi rewrite 3.0?

I want to block:

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0

Current solution, but doesn't work:

RewriteCond %{HTTP:User-Agent} ^Mozilla/5.0\ (Windows\ NT\ 6.1;\ WOW64;\ rv:28.0)\ Gecko/20100101\ Firefox/28.0 [NC]
RewriteRule .? - [F]

I tried so many ways but it doesn't seem to work...

Please help!

1
That's the user-agent i want to block with Helicon's Isapi Rewrite 3.0: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 That's my last solution: RewriteCond %{HTTP:User-Agent} Mozilla/5.0\ (Windows\ NT\ 6.1;\ WOW64;\ rv:28.0)\ Gecko/20100101\ Firefox/28.0 [NC] RewriteRule .? - [F] But the user-agent isn't blocked... it can only depend on some syntax errors - user3668758
Thank you! ... but yes I have... I got that site about 5 times today while trying to find a solution... maybe there is a problem with the blanks or something else...? - user3668758
done... which other information do you need? - user3668758
Logically, you should explain what happens when someone with that User Agent goes to the site currently, and what do you want to happen. - msturdy
What happens: nothing. the RewriteCondition doesnt work What i want to happen: Clients with that User-Agents should be blocked. RADICALLY :) (RewriteRule .? -[F]) that's all i want. No redirection. Just blocking. Helicon's Isapi Rewrite works fine for me with other rules about url-rewriting..., but I'am driving insane cause I know there must only be a tiny syntax mistake in my command... Let me ask my question more exactly: I want the condition to return true for that useragent but it doesn't work. Where is the error? Thank you so much for helping me! - user3668758

1 Answers

1
votes

You need to escape the ( and ) characters in your UA string:

RewriteCond %{HTTP:User-Agent} ^Mozilla/5.0\ \(Windows\ NT\ 6.1;\ WOW64;\ rv:28.0\)\ Gecko/20100101\ Firefox/28.0 [NC]
RewriteRule .? - [F]

( and ) are special characters in Regex