Re: 301 redirect returning 302 instead

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ianevans@xxxxxxxxxxxxxx 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');
exit();

Any reason why we're getting a 302 instead of a 301? This is keeping the
pages in Google instead of removing them and using the new location.

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux