Re: [PHP] 301 redirect returning 302 instead

2006-11-06 Thread ianevans
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

Re: [PHP] 301 redirect returning 302 instead

2006-11-04 Thread ianevans
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();

Re: [PHP] 301 redirect returning 302 instead

2006-11-02 Thread ianevans
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

Re: [PHP] 301 redirect returning 302 instead

2006-11-01 Thread ianevans
> 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

Re: [PHP] 301 redirect returning 302 instead

2006-11-01 Thread ianevans
> 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

Re: [PHP] 301 redirect returning 302 instead

2006-11-01 Thread ianevans
> 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

[PHP] 301 redirect returning 302 instead

2006-10-31 Thread ianevans
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