[Zope-dev] ZServer should redirect for folder objects?

Tino Wildenhain tino@wildenhain.de
Thu, 26 Jul 2001 00:05:33 +0200


Hi :-)

--On Donnerstag, 26. Juli 2001 05:44 +0200 Christian Scholz 
<cs@comlounge.net> wrote:

> Hi!
>
>>  > I've been doing some work with Zope and I've noticed strange behavior
>>  > with  regards to ZServer and relative links.
>>  >
>>  > When a client requests an object that is a folder and the request URL
>>  > does  not have a trailing slash, the HTTP server should return an
>>  > HTTP 301  Redirect to the correct URL with the slash, right?
>> Hmm?
>>
>> Apache may do this, but I did not see a clause in the HTTP spec
>> that would require this behaviour.
>
> For Caches it might also be good as otherwise both objects might
> count as two different objects.. That's why apache is doing it, I think.

Its recommended to link to the folder-objects with a traling slash anyway.
The redirect above is even disable-able (what an word ;) with Apache, if
someone wants it.
(For a reason not transparent to me, M$IE always strips trailing slashes
from history links, buts another story)

>> Zope does not do it, but sets a "base" tag.

you can patch the implementation of absolute_url() so it
does not return the full host. (or call is absolute_url(relative=1))
(Does anyone know why absolute_url doesnt this by default?)

> which prevents from mirroring the site in some cases.. at least it
> used to be..  but that's another story.. ;-)

This can be a feature :-) (together with the images without suffix :)

Regards
Tino