httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] RedirectMatch = HideMatch
Date Thu, 05 Jun 2003 17:47:31 GMT

On Thu, 5 Jun 2003, Ken Gillett wrote:
> Well I can't really see that - computers never make sense out of
> garbage:-)

I know you're joking, but what I meant is that Apache did allow users to
send non-RFC compliant redirects in previous version.  Luckily for these
users, the browser would often make some assumptions about what was
intended and perform the redirect anyway.

> The actual line was:
> 	RedirectMatch ".*~(.*[^ ]) ?$" ../$1

> > The docs for Redirect/RedirectMatch are quite clear that only an
> > absolute URL is acceptable:
> >
> Actually, I don't think that is true

The second parameter, according to the "Syntax" is "URL".  If you consult
you'll see that URL means an absolute URL starting with a scheme and

> Seems to have made sense with Apache v1. I'll have a look at some fancy
> regex'ing, but any more assistance with this problem would be much
> appreciated.

It doesn't make sense because the "Location:" HTTP response header
generated by Apache must contain an absolute URL according to the HTTP
specs (RFC 2616 sec 14.30).  You seem to think that a redirect is like an
<a href>, but it is not.  It does not have the same url resolution rules.

Now, I suppose that Apache could impliment those rules for you to send
back to browser, but I think that the results wouldn't be very pleasing in
general, because it would be very difficult to recreate the exact behavior
of the browser in response to that link.

But all is not lost.  Something approaching what you want is

RedirectMatch ^/(.*)/[^/]*/~([^/])$$1/$2

What this does is simply remove the last directory for any filename
starting in ~.  I haven't dealt with the space issue, but you can probably
work that in (although the existence of a bare space seems very unlikely).


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message