|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2000-11-28 05:38 UTC] leen at wirehub dot nl
 in main/SAPI.c:
line    code
   441                                  SG(sapi_headers).send_default_content_type = 0;
   442                          } else if (!STRCASECMP(header_line, "Location")) {
   443                                  SG(sapi_headers).http_response_code = 302; /* redirect */
   444                          } else if (!STRCASECMP(header_line, "WWW-Authenticate")) { /* HTTP Authentication */
   445                                  SG(sapi_headers).http_response_code = 401; /* authentication-required */
   446                          }
   447                          *colon_offset = ':';
   448                  }
My knowledge of C is not so great but I can see that this is being ignored somewhere allong those lines of code (this is part of my script):
header ("HTTP/1.1 307 Temporary Redirect");
header (""Location: "http://<redirlocation>");
Please do something about it, this is very anoying, because this is what I get:
HTTP/1.1 302 Found
Date: Tue, 28 Nov 2000 12:50:46 GMT
Server: Apache/1.3.9 (Unix) Debian/GNU PHP/4.0.3pl1
X-Powered-By: PHP/4.0.3pl1
Location: http://<redirlocation>
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
(ofcourse http://<redirlocation> is then ofcourse a real location)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 17:00:02 2025 UTC | 
Relassified back, CGI of course would work becuase it doesn't prune the HTTP header line as done by most other webservers. SAPI.c does reset response_code when it encounters Location headers A work around is to list the HTTP/1.1 xxx code header after the location header. header ("Location: http://<redirlocation>"); header ("HTTP/1.1 307 Temporary Redirect"); I will be thinking about a possible better way to implement this -Jason