You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Ryan Clifton <rc...@snowcrash.org> on 1998/11/03 02:52:26 UTC
mod_alias/3333: RedirectMatch and Redirect rewrite URLs differently
>Number: 3333
>Category: mod_alias
>Synopsis: RedirectMatch and Redirect rewrite URLs differently
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apache
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Mon Nov 2 19:10:00 PST 1998
>Last-Modified:
>Originator: rclifton@snowcrash.org
>Organization:
apache
>Release: 1.3.1
>Environment:
Solaris 2.6 (and 2.5), apache 1.3.1, gcc
SunOS enterprise 5.6 Generic sun4u sparc SUNW,Ultra-4
>Description:
I am trying to user RedirectMatch to redirect to a servlet. The config line looks like:
RedirectMatch ^/admin(.*)$ http://my.site.com/webj?func=y\&t=1$1
Apache is HTML encoding the '?' as %3f, which causes my servlet to be unable to parse the variable string. (%3f designates specifically to not treat it as a parameter).
If I user Redirect the string is not HTML encodes (unfortunately I need reg-ex parsing or I wouldn't be writing this).
The following works correctly (the '?' is not encoded):
Redirect /admin http://my.site.com/webj?func=y&1
I read through all of the bug report and saw no mention of this, so I did not bother to upgrade from 1.3.1 to 1.3.3.
>How-To-Repeat:
Create two redirects:
Redirect /junk http://your.server.com/junk?x=1&y=2 (works)
final URL looks like : http://your.server.com/junk?x=1&y=2
RedirectMatch ^/junk2(.*) http://your.server.com/junk?x=1\&u=2$1 (encodes the '?')
final URL looks like: http://your.server.com/junk%3fx=1&u=2
>Fix:
RedirectMatch likely is doing an HTML encode unnecessarily.
>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 leave the subject line UNCHANGED. This is not done]
[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! ]