Forum Moderators: phranque
What I have...
RewriteCond %{HTTP_USER_AGENT} DTS\ Agent [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^dumbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR] What came calling...
141.156.39.** - - [04/Jan/2004:16:10:11 -0800] "GET /Blah_Blah.html HTTP/1.0" 200 13835 "-" "Dumbot(version 0.1 beta)" What should keep it away...
RewriteCond %{HTTP_USER_AGENT} DTS\ Agent [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^dumbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR] Is this correct to catch the uppercase Dumbot too? I'm admittedly tired, but I do recall there is a certain circumstance here that I'm not sure about. I just can't remember what that was.
Thanks.
The [NC] flag means that the string comparison will be made without any regard for uppercase/lowercase.
Therefore, "RewriteCond %{HTTP_USER_AGENT} ^dumbot [NC]" will match "dumbot", "DUMBOT", "DuMbOt", or any other combination of letter capitalizations. Neither the case of the actual user agent, nor the case of the pattern in the RewriteCond matters when [NC] is used.
For practical purposes, you can assume that mod_rewrite converts both strings to all-uppercase (or to all-lowercase, it doesn't matter, really) *before* it compares them.
Jim