Re: HTTP headers on 'trailing slash' redirects?

2002-08-12 Thread Phil Stoneman

Monday, August 12, 2002, 9:09:01 AM, you wrote:

 Phil Stoneman says:
 
 Now, my problem is this: Apache(1.3.26) is sending 301
 (HTTP_MOVED_PERMANENTLY) when it does the 'trailing slash' redirects
 to contruct a valid URI for a directory. This is technically not
 against the RFC from what I can see. It is a bit annoying, though,
 since when tinkering with UseCanonicalName in the config file, the
 browser cached the redirect and made me think apache wasn't getting
 its own hostname correctly.
 I've tested IIS 5.0, and this does seem to send 302
 (HTTP_MOVED_TEMPORARILY), which is what I'd imagine should be done.
 Also, I've found a reference on google groups to apache 1.2b8 where
 this behaviour was changed as I'm looking for:
 http://groups.google.com/groups?selm=334AF61F.26A5%40DECUS.Orgoutput=gplain
 (The bit in question was written by Markus Gyger, and is about halfway
 down)

 Seems to me that a URL pointing to a directory always has to end with a 
 slash, and therefor it is permanent. Why would it be temporary?

Hmm... I'm not entirely sure, to be honest. I wouldn't really
consider myself experienced in any way with the inner workings of web
servers.
However.
It does strike me that the object could concievably change between
being a directory and being a file, for example, meaning that a cached
redirect (Which is what seems to happen with a permanent redirect) is
an annoyance.

Also, it appears that IIS (at least 5.0, which I've tested for this)
and Apache 1.2b8 (from that changelog I found) do respond with a 302
(temporary redirect). I'm wondering why the current Apache's behaviour
is different, that's all.

Also, is there any way to persuade apache to do this right with
mod_rewrite?

Thanks

Phil

-- 
 Phil Stonemanmailto:[EMAIL PROTECTED]




HTTP headers on 'trailing slash' redirects?

2002-08-11 Thread Phil Stoneman

First of all, I'll apologise for posting this here if there's a better
place, or it's answered elsewhere. I've looked as hard as I can for an
answer (on the apache site, all throughout google and google groups,
and so on), but can't find anything anywhere.

Now, my problem is this: Apache(1.3.26) is sending 301
(HTTP_MOVED_PERMANENTLY) when it does the 'trailing slash' redirects
to contruct a valid URI for a directory. This is technically not
against the RFC from what I can see. It is a bit annoying, though,
since when tinkering with UseCanonicalName in the config file, the
browser cached the redirect and made me think apache wasn't getting
its own hostname correctly.
I've tested IIS 5.0, and this does seem to send 302
(HTTP_MOVED_TEMPORARILY), which is what I'd imagine should be done.
Also, I've found a reference on google groups to apache 1.2b8 where
this behaviour was changed as I'm looking for:
http://groups.google.com/groups?selm=334AF61F.26A5%40DECUS.Orgoutput=gplain
(The bit in question was written by Markus Gyger, and is about halfway
down)

I've tried looking for the apache ChangeLogs, but the announce listbot
won't give me that far back. Does anyone know why this behaviour was
changed back since then?
It seems to be in mod_dir.c where it actually decides it's a permanent
redirect. I could just edit the source, but I'm interested to know why
this behaviour (sending a permanent redirect) was chosen in the first
place.

Does anyone know of a way I can persuade apache to make
'trailing-slash' redirections only temporary redirections, perhaps
using mod_rewrite or something? Modifying the source would work, but
would break as soon as a new version of apache was released

Thanks very much

Phil

P.S. I doubt it's hugely important, but relevant things are:
Apache 1.3.26
Linux 2.4.18 (Slackware 8.1) on intel
mod_ssl 2.8.10 for apache 1.3.26 and openSSL 0.9.6g

--
 Phil Stoneman  mailto:[EMAIL PROTECTED]