[Zope] More problems with redirecting from standard_error_message

Alan Capesius alanc@tech-world.com
Mon, 9 Jul 2001 11:45:47 -0500


The page is here message is just text, not a browser directive.

You can add a META refresh to your page if you want the user to see the
redirect:
Here's the format. The 3; is a 3-second delay. DO NOT make it zero or 1,
that's rude.

<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh" Content="3;URL=http://www.twstore.com">
</HEAD>
<H3>OOPS!  The Tech World Store has been redesigned</H3>
<H3>You are being redirected to: <a href="http://www.twstore.com">The Home
Page</A></H3>.
</HTML>


Otherwise use this format (which I dug out of the mailing list archive):
http://zope.nipltd.com/public/lists/zope-archive.nsf/ByKey/9A8889BEB902CCF2

<dtml-if "error_type=='NotFound'">
  <dtml-call expr="RESPONSE.redirect('http://www.twstore.com', status=301,
lock=1)">
<dtml-else>
   ...The normal standard_error_message is here...
</dtml-if>

That doesn't match the DTML docs at zope.org, but it works.
Use
         301 Moved Permanently
         302 Moved Temporarily
A 301 instructs search engines etc, to correct their databases.
http://www.ics.uci.edu/pub/ietf/http/rfc1945.html#Code301



- Alan
---------------------------------------
Zope tips and tricks site
http://twsite.bizland.com/zopetips.htm
This item posted at:
http://twsite.bizland.com/twzop0023.htm



> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Peter
> Hernberg
> Sent: Monday, July 09, 2001 10:58 AM
> To: zope@zope.org
> Subject: [Zope] More problems with redirecting from
> standard_error_message
>
>
> I recently posted about problems redirecting from
> standard_error_message (see
> http://lists.zope.org/pipermail/zope/2001-July/094515.html).
> After reading the
> docs on redirecting from standard_error_message
>  (http://www.zope.org/Members/JohnC/StandardErrorMessage), I tried using
> RESPONSE.redirect(). No matter where I call RESPONSE.redirect().
> I've whittled
> down my standard_error_message to
>
> <dtml-if "error_type=='NotFound'">
>   <dtml-call "RESPONSE.redirect('http://www.newsite.com/index_html')">
>   <html>
>   <body>
>   The page you requested is now <a
> href="http://www.newsite.com/index_html">here. </a>
>   </body>
>   </html>
> <dtml-else>
>    ...The normal standard_error_message is here...
> </dtml-if>
>
>