[Zope] 'Netscape style.css recursion' & Zope - Gotcha

Chris Hinds chris@palefish.co.uk
Tue, 31 Jul 2001 13:03:20 +0100


Hullo!

I'm sure this will be obvious to some, but it took me the best part of a 
morning to figure out so I thought i'd post it anyway...

I had a problem with Netscape (on linux) going into an infinite loop looking 
for a stylesheet when retrieving a non-existent url from zope. Here's why:

Imagine serving up a page on http://127.0.0.1:8080/foo/bar

<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
</head>

<body>
<p>
This is the index_html Document.
</p>
</body>

</html>

split up into standard_header_html and standard_footer_html as expected.

Now visit a non-existent url eg http://127.0.0.1:8080/fu/bar 
Zope now serves up standard_error_message eg

<dtml-var standard_header_html>

oh dear, an error has occurred...

<dtml-var standard_footer_html>

This causes Netscape to retrieve http://127.0.0.1:8080/fu/bar/style.css which 
of course it can't find, so it tries again, and again.... (_duh_)

So the moral of this story:
- In line you style sheets?
- use an absolute link to style.css not a relative one?
- have a more independent standard_error_message page?
- get Zope to redirect to a standard error page rather than inherit it?

Hope someone finds this useful!
regards,
Chris.