Received: (qmail 29470 invoked by uid 501); 25 Aug 2000 15:45:57 -0000 Message-Id: <20000825154557.29469.qmail@locus.apache.org> Date: 25 Aug 2000 15:45:57 -0000 From: Matthew Keller Reply-To: kellermg@potsdam.edu To: submit@bugz.apache.org Subject: RewriteCond not properly using [NC] (no case) flag X-Send-Pr-Version: 3.110 >Number: 6468 >Category: mod_rewrite >Synopsis: RewriteCond not properly using [NC] (no case) flag >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Fri Aug 25 08:50:00 PDT 2000 >Closed-Date: Tue Oct 17 22:15:04 PDT 2000 >Last-Modified: Tue Oct 17 22:15:04 PDT 2000 >Originator: kellermg@potsdam.edu >Release: 1.3.12 >Organization: >Environment: Linux armkreuz.potsdam.edu 2.2.14-5.0smp #2 SMP Thu Jun 22 12:58:37 EDT 2000 i686 unknown gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) >Description: I've got an environment where both /home/groups and /home/users have to appear on the root of a virtual host. To cut to the chase, I'm using mod_rewrite to do this, and it works great. The problem, is that I'm also using mod_speling to correct mis-capitalized URI's (I just moved them from a Mac webserver that was case-insensitive to a Linux+Apache solution *cheers*). The RewriteCond line is as follows: RewriteCond /home/users%{REQUEST_FILENAME} -F [NC] Below is a line from the rewrite log that "looks up" a file, and says "not matched" but the file DOES exist, it's just ending with '.GIF' instead of '.gif' 137.143.111.133 - - [25/Aug/2000:10:57:29 -0400] [www2.potsdam.edu/sid#81002dc][rid#810862c/initial] (4) RewriteCond: input='/home/users/sipherjd/gif/jdspict.gif' pattern='-F' => not-matched I really don't think this is because I've mis-configured mod_rewrite, as it DOES do what it needs to do, it's just not ignoring the case of the files and producing a 'match' when it should. For giggles, the relevant portions of the .conf are below. DocumentRoot /home/managed/groups RewriteCond /home/managed/groups%{REQUEST_FILENAME} -F [NC] RewriteRule ^(.+) - [PT] [L] RewriteCond /home/users%{REQUEST_FILENAME} -F [NC] RewriteRule ^(.+) /home/users$1 [L] RewriteRule ^(.+) - [PT] [L] >How-To-Repeat: Doesn't work - http://www2.potsdam.edu/sipherjd/gif/jdspict.gif Works - http://www2.potsdam.edu/sipherjd/gif/jdspict.GIF >Fix: Um, make 'NC' work? Or slap me around if it's my bad. >Release-Note: >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: slive State-Changed-When: Tue Oct 17 22:15:04 PDT 2000 State-Changed-Why: Well, it is not exactly crystal clear in the docs, but I think this is working as intended. The [NC] option is used to make comparisons case- insensitive. It can not be used when doing a file test, since the file system does not have case- insenstitive comparison functions in unix. I've clarified the documentation a little. >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]