def handler(req):
req.headers_out['location'] = 'http://www.modpython.org/'
req.status = apache.HTTP_MOVED_TEMPORARILY
req.send_http_header()
return apache.OK
Care of the mod_python FAQ.
def handler(req):
req.headers_out['location'] = 'http://www.modpython.org/'
req.status = apache.HTTP_MOVED_TEMPORARILY
req.send_http_header()
return apache.OK
1 comment:
You don't need 'req.send_http_header()' for mod_python 3.X, that was only required for mod_python 2.X.
You should also perhaps instead look at the mod_python.util.redirect() function instead. See 'http://www.modpython.org/live/current/doc-html/pyapi-util-funcs.html.
Finally, one should be redirecting oneself to 'www.modwsgi.org' these days and not 'www.modpython.org'. ;-)
Post a Comment