www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Crooke <d...@convio.com>
Subject mod_alias/7503: PATCH: RedirectMatch is inconsistent with Redirect
Date Tue, 03 Apr 2001 06:16:03 GMT

>Number:         7503
>Category:       mod_alias
>Synopsis:       PATCH: RedirectMatch is inconsistent with Redirect
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Mon Apr 02 23:20:00 PDT 2001
>Originator:     dave@convio.com
>Release:        1.3.x
Not system specific - tested on Linux 2.2.12 (Red Hat 6.1) and FreeBSD
4.0_RELEASE, both with gcc
The result of a RedirectMatch directive is urlencoded before returning it
to the browser. This behaviour is inconsistent with Redirect, and is contrary
to the more common use case and most users expectations.

A more complete fix would also add a flag to these directives which would dump
the inbound querystring. I will colunteer to write this if you would like to
include it.
Use the following in httpd.conf

RedirectMatch 301 /foo.html /cgi-bin/page.pl?page=foo
Redirect 301 /bar.html /cgi-bin/page.pl?page=bar

and then try the URLs


The former redirects to


which is not the common use case.

See also GNATS entries 3333, 4379, 5948 which this patch also fixes

The following diff works against (at least) 1.3.12 through 1.3.19...

--- mod_alias-old.c	Tue Apr  3 01:18:14 2001
+++ mod_alias.c	Mon Apr  2 20:58:47 2001
@@ -304,9 +304,15 @@
 		if (p->real) {
 		    found = ap_pregsub(r->pool, p->real, r->uri,
 				    p->regexp->re_nsub + 1, regm);
+		    /*

+		      Patch to allow use of querystrings in RedirectMatch

 		    if (found && doesc) {
 			found = ap_escape_uri(r->pool, found);
+		    */

 		else {
 		    /* need something non-null */

 [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