[Zope] RESPONSE.redirect in Python Script?

Curtis Maloney curtis@cardgate.net
Fri, 9 Feb 2001 11:47:01 +1100


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