You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Laurent Lechelle <ll...@teaser.fr> on 2002/01/30 21:46:38 UTC

Problem with RedirectMatch and '?'

Hello, 

Running Apache 1.3.22, I have this RedirectMatch definition in my conf file. 

<VirtualHost 132.85.70.26>
ServerName www.mycomp.com
RedirectMatch permanent /(.*) 
http://www2.mycomp.com/index.php?id=expenses_ime
</VirtualHost> 

The request received by www2 is
/godefroy/index.php%3fid=expenses_ime
(note the ? changed to %3fd) 

Is RedirectMatch wrong, or is urldecoding on www2 wrong? 

 --
||  Laurent Léchelle, Paris, France, Internet 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Problem with RedirectMatch and '?'

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 30 Jan 2002, Laurent Lechelle wrote:

> Joshua Slive écrit:
>
> > Personally, I've never really understood why Redirect(Match) does
> > url encoding.  I would think it should be left to the user.
>
> I found this information in the bug database for PR7503
> (http://bugs.apache.org/index.cgi/full/7503). It says that it will be fixed
> in 2.0, a patch is available for 1.3.
>
> =====================================================
> State-Changed-Why:
> We can't just remove the escaping, because it is possible
> to redirect to a file with a space in it.  If we don't
> escape the URI, then we will redirect to an invalid URL.
> The problem is that we are escaping too much.  Currently we escape the URI
> and the QUERY_STRING.

Yes, I know, but I don't think that is valid.  I think it should be a
configuration error to redirect to an invalid URL.  We shouldn't just take
an invalid URL and try to make it valid.  We should be assuming that an
HTTP server administrator knows enough to construct well-formed URLs.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Problem with RedirectMatch and '?'

Posted by Laurent Lechelle <ll...@teaser.fr>.
Joshua Slive écrit: 

> Personally, I've never really understood why Redirect(Match) does
> url encoding.  I would think it should be left to the user.

I found this information in the bug database for PR7503 
(http://bugs.apache.org/index.cgi/full/7503). It says that it will be fixed 
in 2.0, a patch is available for 1.3. 

=====================================================
State-Changed-Why:
We can't just remove the escaping, because it is possible
to redirect to a file with a space in it.  If we don't
escape the URI, then we will redirect to an invalid URL.
The problem is that we are escaping too much.  Currently we escape the URI 
and the QUERY_STRING.
... 

State-Changed-When: Fri May 11 08:21:08 PDT 2001
State-Changed-Why:
This patch has been committed, and will be available with
Apache 2.0.
===================================================== 

> You should be able to get around your problem by using
> RewriteRule instead.

Yes. Why didn't I try it?
Many thanks. 

 --
||  Laurent Léchelle, Paris, France, Internet
||  E-mail: laurent@lechelle.net

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: Problem with RedirectMatch and '?'

Posted by Joshua Slive <jo...@slive.ca>.
> From: Laurent Lechelle [mailto:llechelle@teaser.fr]

> RedirectMatch permanent /(.*)
> http://www2.mycomp.com/index.php?id=expenses_ime
>
> The request received by www2 is
> /godefroy/index.php%3fid=expenses_ime
> (note the ? changed to %3fd)
>
> Is RedirectMatch wrong, or is urldecoding on www2 wrong?
>

Personally, I've never really understood why Redirect(Match) does url
encoding.  I would think it should be left to the user.

You should be able to get around your problem by using RewriteRule instead.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org