Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26317 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14048 invoked by uid 1010); 4 Nov 2006 07:45:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 14033 invoked from network); 4 Nov 2006 07:45:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2006 07:45:22 -0000 X-Host-Fingerprint: 75.19.29.33 adsl-75-19-29-33.dsl.irvnca.sbcglobal.net Received: from [75.19.29.33] ([75.19.29.33:28688] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/34-08797-0154C454 for ; Sat, 04 Nov 2006 02:45:21 -0500 Message-ID: <76.34.08797.0154C454@pb1.pair.com> To: internals@lists.php.net Date: Fri, 03 Nov 2006 23:45:39 -0800 User-Agent: Thunderbird 1.5 (Windows/20051229) MIME-Version: 1.0 References: <3799.64.231.34.61.1162623444.squirrel@www.digitalhit.com> In-Reply-To: <3799.64.231.34.61.1162623444.squirrel@www.digitalhit.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 75.19.29.33 Subject: Re: Problems with 301 redirects From: unknown@simplemachines.org ("Unknown W. Brackets") Shouldn't you use... header('HTTP/1.0 301 Moved Permanently'); header('Location: http://...'); That is what I've always used and it's worked for me. Additionally, the method you have suggested does not work for me. -[Unknown] -------- Original Message -------- > Someone on the php-general list suggested I write here before submitting > this to bugs.php.net to see if it was a known issue. > > Having a problem here trying to redirect some old pages. Running php 5.1.4 > as fastcgi under lighttpd. > > 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("Status: 301 Moved Permanently"); > header("Location: mynewurl"); > exit(); > > The header checker is returning this: > > #1 Server Response: oldurl > HTTP Status Code: HTTP/1.0 302 Found > Connection: close > X-Powered-By: PHP/5.1.4 > Location: mynewurl > > 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. > > As per suggestions on the general list I've tried the status line before > and after the location. I've used the HTTP version instead of the > "Status:" etc. >