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 Chris Shiflett
[EMAIL PROTECTED] wrote: header('HTTP/1.1 301 Moved Permanently'); header('Location: newurl'); exit(); If you're using PHP 4.3 or later, header() lets you set the response status code with the third argument. Otherwise, sending a Location header sets the response status code to 302. If you're

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 Stut
[EMAIL PROTECTED] wrote: 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');

Re: [PHP] 301 redirect returning 302 instead

2006-11-01 Thread Kris Leech
I think Stut is right, you only need the one header! Stut wrote: [EMAIL PROTECTED] wrote: 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:

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

Re: [PHP] 301 redirect returning 302 instead

2006-11-01 Thread Ed Lazor
Have the lighttpd guys come up with any ideas? On Nov 1, 2006, at 10:24 AM, [EMAIL PROTECTED] wrote: 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,

Re: [PHP] 301 redirect returning 302 instead

2006-11-01 Thread Richard Lynch
On Wed, November 1, 2006 12:24 pm, [EMAIL PROTECTED] wrote: 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

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 Curt Zirzow
On 11/1/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 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. Just to add more info: We're running php as fastcgi under lighttpd. Doing a little searching I

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

[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