[Zope] RESPONSE.redirect in Python Script?
Walter Miller
wmiller@macromedia.com
Thu, 8 Feb 2001 16:44:41 -0800
I get this error:
Error Type: NameError
Error Value: RESPONSE
I'm actually trying to do this in an Access Rule to be used along with a VHM
(much thanks to Evan for helping me get that set up). The code goes
something like this:
"""
host = req['HTTP_HOST']
stack = req['TraversalRequestNameStack']
if host == 'www.foo.com':
stack.extend(['VirtualHostRoot', 'foo', 'vhosts'])
elif host == 'foo.com':
return RESPONSE.redirect('http://www.foo.com')
"""
BTW, I'm using 2.3.0 on FreeBSD 4.2
-----Original Message-----
From: Curtis Maloney [mailto:curtis@cardgate.net]
Sent: Thursday, February 08, 2001 4:17 PM
To: Walter Miller; 'zope@zope.org'
Subject: Re: [Zope] RESPONSE.redirect in Python Script?
On Friday 09 February 2001 11:11, Walter Miller wrote:
> Any idea how to do a RESPONSE.redirect() in a python script?
>
> TIA,
>
> Walter
>
return RESPONSE.redirect(url)
works for me.
Have a better one,
Curtis Maloney