httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 54580] Redirect error with FQDN and directory seperation
Date Tue, 19 Feb 2013 16:10:33 GMT

--- Comment #28 from Erwann Abalea <> ---
(In reply to comment #26)
> Eric,
> Its not invalid. If someone requests /foobar/ and the redirect URL is
> '', then Apache should be putting '' and '/foobar/'
> together, to make ' Instead, Apache leaves out the
> forward-slash at the beggining of 'foobar' resulting in 'example.comfoobar'.
> How is this not a bug?

It's the intended purpose. But you fail to read the documentation and normative

The directive:
Redirect /
is to be read like this: if the request starts with a '/' (did you notice the
first argument? you don't mention it, but it's here), then strip this leading
'/' and add what remains to the end of "".

With such a directive and your example (/foobar/), then yes, the result will be
a redirect to "http://example.comfoobar/" which probably won't work (it may
work, depending on your network configuration).

If what you want is redirect everything from "" to
"", then you can use either one of (probably non
exhaustive list):

Redirect /
RedirectMatch (.*)$1
RewriteRule ^(.*)$$1 [redirect=301]

Your first PHP pseudocode didn't work (see comment 20). Your second PHP
pseudocode don't allow to perform the following kind of redirection:
Redirect /documents/lang/en/ /lang.en.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message