[Zope3-dev] Relative links

Guido van Rossum guido@python.org
Tue, 26 Mar 2002 22:26:53 -0500


> Chris McDonough wrote:
> > 
> > http://lists.zope.org/pipermail/zope-coders/2001-November/000460.html . I
> > believe the only other option with the current state of affairs is
> > redirection to "container/" when you visit a containerish object.
> 
> I've always seen that as a much nicer and more 'correct' approach.

-1.

My objection to <base> is not to the fact that it is inserted using an
ugly hack (which it is -- occasionally it doesn't get inserted, when
your template is missing a </head>).

My beef is that for sites (or sections of sites) that to the user
resemble a collection of static HTML, sucking down a copy for a mirror
(possibly for private use only) becomes much harder.  This is because
the <base> elements remain in the mirrored pages, so the mirrored
links point back to the original site rather than to the mirror.

(Note, your wget may be smart enough to munge <base> elements, but not
all of them are.)

I still think that the best solution is what Apache does for
directories (redirect to the directory with a / appended).  I do see
that for some sites this might be too expensive, so it should be a
site (or subtree) configuration parameter.

I think the default should be the redirect (thus giving all of you the
ability to earn some consilting dollars for performance tuning sites
:-).

I keep harping on this issue because the python.org site is carefully
constructed using relative URLs only to allow easy mirroring, and
there are dozens of mirrors; I couldn't consider migrating python.org
to Zope without a decent approach to relative URLs.

This issue is also one of the last issues that bug me in the jobboard
example; when I point my browser to http://localhost:8080/jobboard/ I
get a <base> tag with an href attribute pointing to
http://localhost:8080/jobboard/summary/index.html.  I really wish the
"summary/" part was unnecessary (the "index.html" part is already
unnecessary).  But I can't figure out how to do this.

--Guido van Rossum (home page: http://www.python.org/~guido/)