You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Martin Zeh <ma...@sat1.de> on 1999/09/28 18:19:05 UTC

mod_rewrite/5073: mod_rewrite drop the QUERY_STRING using the [P] flag on per-dir context

>Number:         5073
>Category:       mod_rewrite
>Synopsis:       mod_rewrite drop the QUERY_STRING using the [P] flag on per-dir context
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Sep 28 09:20:00 PDT 1999
>Last-Modified:
>Originator:     martin.zeh@sat1.de
>Organization:
apache
>Release:        1.3.9
>Environment:
SunOS obelix 5.5.1 Generic_103640-27 sun4m sparc SUNW,SPARCstation-20
egcs-2.9.5
>Description:
The mod_rewrite in the apache 1.3.9 strip off the QUERY_STRING if
the force proxy flag is used in the per-directory context.
I think the same bug is reported earlier but the author forgot
the per-directory context. If [P] is used in global context all
is fine.
>How-To-Repeat:
This configuration doesn't work with 1.3.9.
With apache 1.3.6 it worked well!

<Location /hack>
   RewriteEngine On
   RewriteRule ^.*/htdocs/hack(.*)$ http://hugo.sat1.de:88/hack$1 [P,L]
</Location>
>Fix:
I comment the line 1377 in mod_rewrite.c but I didn't check the side
effects! After this change the QUERY_STRING is appended

1376: if (r->args != NULL) {
1377:    /* Martin Zeh changed 28.09.1999 && r->uri == r->unparsed_uri) { */
1378:    /* see proxy_http:proxy_http_canon() */
1379:    r->filename = ap_pstrcat(r->pool, r->filename,
1380:    "?", r->args, NULL);
1381: }
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@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!     ]




Re: mod_rewrite drop the QUERY_STRING using the [P] flag on per-dir context

Posted by Eric Prud'hommeaux <er...@w3.org>.
Dear Martin Zeh,

The fix for bug number 5073 is causing some trouble with rewrites that
match uris with no '?' in them but have one appended by the rewrite
rule. The '?' ends up encoded as %3F which hides the following
parameters from CGI. There appears to be no way to prevent this. this
problem does not occur in rewrites that are not in a directory
context.

I would like to fix this bug and re-establish the symetry between the
per-dir and global rewrites. I think there may be a way to fix 5073
without causing this new bug. Would you please check to see if your
bug occurs in the current distribution if you put the
"r->uri == r->unparsed_uri" 
check back into mod_rewrite.c?

If the bug was a manifestation of something that has been fixed in the
mean time, we could remove the patch and have the per-dir rewrite
logic be the same as the global rewrite logic.

If the bug persists for you, I would like to work with you to find a
solution that doesn't create this encoding problem. Thank you for
your assistance.

-- 
-eric

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.