[Zope] confusing redirect problem

Simon Brun simon@tac.ch
Thu, 21 Feb 2002 11:11:07 +0100


hi

I use Zope 2.4.0 (source release, python 2.1.1, linux2)

I want to display my own 404 error page. So I added a the following
lines to my Standard Error Message:

<dtml-if "error_type == 'NotFound'">

     <dtml-let target="'index_html'">

         <h1>This page has moved, you will now be redirected to the
         correct location.  If your browser does not redirect, click
 	 <a href="<dtml-var target>"><dtml-var target></a>.</h1>

         <dtml-call expr="RESPONSE.redirect(<dtml-var target>)">

     </dtml-let>

</dtml-if>

index_html is a simple HTML only dtml-document:

<html>
<head><title>foo...</title></head>
<body>

... bar

</body>
</html>


When I enter now a wrong URL (e.g. http://myip:8080/nothing) there is
happening something very confusing.
I see the html-code (without html, head, body at the beginning) from the
index_html with "Bobo-Exception-Value" at the end and under it the
forwarding text ("This page has moved, you will now be...").

Here the output:

... bar</body></html> Bobo-Exception-Value: bobo exception
Content-Length: 1015 Bobo-Exception-Line: 547 

This page has moved, you will now be redirected to the correct location.
If your browser does not redirect,
click index_html.


The URL in the browser doesn't change from 'http://myip:8080/nothing' to
'http://myip:8080/index_html.
I tested it with Netscape 4.77, Netscape 6.0..

Thx for any help.

regards
simon