Forum Moderators: phranque

Message Too Old, No Replies

Condensing RewriteCond

         

keyplyr

9:04 pm on Jan 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This...

RewriteCond %{HTTP_USER_AGENT} MS.*Office [NC,OR]
RewriteCond %{REQUEST_URI} MSOffice [NC]
RewriteRule!^forbidden\.html$ - [F]

Did not stop this...

165.21.XX.XX - - [06/Jan/2004:08:40:43 -0800] "OPTIONS / HTTP/1.1" 200 - "-" "Microsoft Office Protocol Discovery"

So I'm adding this...

RewriteCond %{HTTP_USER_AGENT} Microsoft\ Office [NC,OR]

Surely this can be condensed? Thanks.

jdMorgan

2:22 am on Jan 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



keyplyr,

There's no need to redirect Options requests -- your server doesn't support any, as evidenced by the zero-length response. Redirecting or returning an error response will only cost you bandwidth and provide no gain.

Also, the second RewriteCond in your code snippet is redundant, since the pattern "MS.*Office" will match the user-agent "MSOffice" (because ".*" means "any number of characters, including zero").

Jim