Just upgraded to 5.2.0 and alas, the 301/302 issue still exists. Guess
I'll head off to bugs.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Chris,
I just posted this to php-internals in response to someone else, but this
tale of woe shows the problem:
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://...";);
exit();
produces a 302.
header("Location: http://...";);
header("HTTP/1.1 301 Moved Permanently");
exit();
Still scratching my head on this one...
According to what I've read, when php is run as a CGI then a Status:
number text header should be set instead. Add to that the header docs on
the php site say that "The second special case is the "Location:" header.
Not only does it send this header back to
> what version of php?
PHP 5.1.4 (cgi-fcgi)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Write a quick-hack Perl script to just do a 301 and Location and see
> if Perl+lighthttpd gets you a 302 or a 301.
Did as you suggested and perl+lighttpd produces the 301 as expected.
So the unwanted 302 is just lighttpd+php.
This seems to be connected to http://bugs.php.net/bug.php?id=36705
> Just a shot in the dark, but it's possible that providing a "Location"
> header resets the status response. Try swapping your two header calls.
Stut:
Flipping the headers doesn't work, unfortunately, running wget still shows
a 302 being returned.
Kris:
You need both headers. Just giving the Loc
Having a problem here trying to redirect some old pages.
I've recently noticed using a server header check that my 301 redirects in
PHP are returning 302 instead.
I'm using the following code:
header('HTTP/1.1 301 Moved Permanently');
header('Location: newurl');
exit();
The header checker is r
7 matches
Mail list logo