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
[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
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
[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');
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:
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
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,
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
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
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
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
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
13 matches
Mail list logo