[Zope] standard_err_message ques... repost

Howard Hansen howardh@halfmagic.com
Mon, 7 Oct 2002 11:48:50 -0700


You might also take a look at JRedirector, which sticks redirection code at
the top of standard_error_message to send you to the redirector.  It can
give you a pretty 404 message if needed, and redirect old urls to new paths.
Pretty slick product.  I like it.

JRedirector: http://www.dataflake.org/software/jredirector

Oh, and I'll note that you shouldn't follow the README.txt directions
exactly. In order for the needed dtml code to display in some browsers, Jens
put spaces between the less than sign and the dtml tag name.  The correct
code is:

    <dtml-if expr="error_type == 'NotFound'">
      <dtml-call expr="redirector_object.redirect( REQUEST )">
    </dtml-if>

I initially copied and pasted the code into standard_error_message.  That
misunderstanding cost me several dozen hair follicles and more time than my
pride allows me to admit!


Howard Hansen
http://howardsmusings.com/categories/zope


----- Original Message -----
> Date: Mon, 07 Oct 2002 14:31:23 +0100
> From: Chris Withers <>
> To: AM <list_subscriber@neurobs.com>
> CC: Zope <zope@zope.org>
> Subject: Re: [Zope] standard_err_message ques... repost
>
> AM wrote:
> > and put a simple
> >
> > <dtml-if "error_type=='NotFound'">
> > <dtml-call "RESPONSE.redirect(errors.e404.absolute_url())">
> > </dtml-if>
> > at the top of my standard_error_message.
> >
> > Unfortunately when I try to hit a non-existant page I do not get
> > redirected to the error page, I still get the Debugging Notice.... blah
> > blah blah
>
> Did you read all of the How-To? Especially the bit about "How do I
redirect
> broken links?"
>
> Try:
> <dtml-call "RESPONSE.redirect(errors.e404.absolute_url(),lock=1)">
>
> cheers,
>
> Chris