| 10:34 pm on Jun 18, 2003 (gmt 0)|
Yes, the repeated status causes confusion.
To stop it happening, just put the status header before the location header.
| 10:38 pm on Jun 18, 2003 (gmt 0)|
I've already tried it that way, still the same result.
| 10:51 pm on Jun 18, 2003 (gmt 0)|
I believe the Location header sets the 302 header for you. You should not try and set another header if you are doing a location command. This may be a PHP bug, as I know I have encountered it in the past.
| 11:20 pm on Jun 18, 2003 (gmt 0)|
The php manual says
|The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set. |
The discussion on php.net about the header function suggested setting the status code in the way I have done, but it doesn't look good.
| 11:41 pm on Jun 18, 2003 (gmt 0)|
Looks like a bug to me, I just never worried about it because it set a 302. You might file it under bugs.php.net
| 5:52 am on Jun 19, 2003 (gmt 0)|
A bit more playing and reading, and I've got it right.
header("HTTP/1.1 301 Moved Permanently");