www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charlie Collins <char...@screaming-penguin.com>
Subject mod_rewrite/8272: mod_rewrite disregards URI if "?" is present (ie any querystring) AND additional search after said ? is performed
Date Thu, 30 Aug 2001 19:42:58 GMT

>Number:         8272
>Category:       mod_rewrite
>Synopsis:       mod_rewrite disregards URI if "?" is present (ie any querystring) AND
additional search after said ? is performed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Thu Aug 30 12:50:00 PDT 2001
>Originator:     charlie@screaming-penguin.com
>Release:        1.3.20
RedHat Linux 6.2 (kernel 2.2.14)  
Please fogive me for bothering anybody if this is a known issue or not valid for any reason.
I did
as much research as possible first and can find no other commentary on a problem that I am
with mod_rewrite and I can reproduce on different machines. 

Basically anytime I am using mod_rewrite to search for a portion of a querystring that is
passed to a URI
it does not work.  I have logged the activity extensively and when the "?" is present in a

URI that is being searched it does not even show the real URI in the rewrite log. 

Note that this DOES NOT HAPPEN if I search for the first part of the URI before the 
qyestion mark (?) and querystring and just say give me all of said URI. 

For Example:
URL:     http://foo?page=3&param=2
Rule:    RewriteRule ^/foo(.*)  http://somewhere/foo$1

this works great even when a querystring is present such as this example URI

however if I search for a specific parameter in the querystring the same URI which
previously registered a hit via mod_rewrite and got redirected is now ignored. 

For Example:
URL:     http://foo?page=3&param=2
Rule:    RewriteRule ^foo(.+)page=3(.*)  http://somewhere/foo$1page=3$2

this does NOT WORK and again the rewrite log shows the URI as everything UP TO the 
? and then it passes every the rule and is not touched.  However in this same example
if I simply remove the question mark (?) from the URI it DOES get redericted and the rewrite
log clearly shows the rule catching the parameter.  

I have tried the rules in many different forms all with the same result (yes, I have 
escaped the ? also, such as ^foo\?(.*)page=3(.*) with the same result.)  I have used 
the same regexp expressions in other formats and they work (sed.)  

This problem only happens when searching for a parameter in the querystring of the URI, if
entire querystring is matched it is not an issue.


 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> 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!     ]

View raw message