[Zope] URLs and /

DA Loeffler David.Loeffler@bristol.ac.uk
Tue, 6 Aug 2002 11:46:12 +0100 (BST)


I have been experiencing a problem with relative URLs.

If I have a folder 'myFolder' and the user enters the
address [mysite]/myFolder, they are automatically redirected to
[mysite]/myFolder/index_html, but their browser does not realise this.
So if I have a relative link in the page <a href="somefile"> which is
intended to point at /myFolder/somefile, the browser, thinking it is
reading a _file_ called 'myFolder' in the root folder, then requests
/somefile, not /myFolder/somefile, and Zope quite rightly replies that
it doesn't exist.

How do I get round this one? For ordinary links it can be fixed with a
<base> tag whose href is set to absolute_url(), but this isn't respected
by JavaScript window.location.href="" statements. The only solution I
have found so far is for index_html to do a RESPONSE.redirect to a
different file, whose URL is then right, but this is grungy. Does anyone
have any better ideas?


David