|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, I need some help here please..
I'm using with mod_python. In the request handler I want to redirect the client to a new url, but it seems that the 'Locate' header(and any other header that I tried) is not being sent to the client. The code of testPage.py is: from mod_python import apache def handler(req): req.headers_out.add('Location:','http://www.cnn.com') #req.write("blabla") Here's the .htacess file's code: AddHandler python-program .py PythonHandler testPage PythonDebug On RewriteEngine on RewriteRule !\.(gif|jpg|png|css)$ testPage.py What am I doing wrong?! thanks Roy |
|
#2
|
|||
|
|||
|
The answer..
using:
req.headers_out.add("Location", 'http://www.google.com/') raise apache.SERVER_RETURN, apache.HTTP_SEE_OTHER |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > sending headers in mod_python |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|