[Zope] Hmm weird!

Chris Withers chrisw@nipltd.com
Mon, 19 Mar 2001 10:19:22 +0000


Phil Harris wrote:

> If I put http://localhost:12380/test I get this result:
> 
> <a href="index_html">click here to refresh</a>

> If I put http://localhost:12380/test/ into the address bar I get:
> 
> <a href="index_html">click here to refresh</a>
> 
> Which I have to admit looks identical, *BUT* the anchor takes you to
> different addresses.

This is a relative URL problem (the reason why Zope is known to put that BASE
tag in some times ;-)
I'm pretty sure browsers build relative URLs reltive to the last slash in the
URL they're given, unless there's a base tag present.

So, in your first example you get http://localhost:12380/index_html
In the second, you get http://localhost:12380/test/index_html

You get similar problems with cookies unless you specify a path of / ;-)

Anyway, the way I usually get around this would be to do:
<a href="&dtml.url-index_html;">click here to refresh</a>

HTH,

Chris