Re: 301 redirect returning 302 instead
| From: | Chris Shiflett | Date: | Sat, 04 Nov 2006 08:39:12 +0000 |
| Subject: | Re: 301 redirect returning 302 instead | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244199@lists.php.net to get a copy of this message | ||
ianevans@digitalhit.com 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/