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
On Friday 09 February 2001 11:44, Walter Miller wrote:
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
What parameters are you passing to the method? I am not familiar with the details of VHM... If you are not passing RESPONSE, but are passing REQUEST, you can get REQUEST.RESPONSE.redirect() otherwise, life gets interesting.... and you have to go ask someone else.. (o8 Have a better one, Curis Maloney
participants (3)
-
Chris Withers -
Curtis Maloney -
Walter Miller