Re: 301 redirect returning 302 instead

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

 



ianevans@xxxxxxxxxxxxxx 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 using an old version of PHP, you should try reversing the
order of the header() calls in your example, if you haven't already.

Hope that helps.

Chris

-- 
Chris Shiflett
http://shiflett.org/

-- 
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