note 78088 added to function.header

From: Date: Thu, 27 Sep 2007 08:10:48 +0000
Subject: note 78088 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-130829@lists.php.net to get a copy of this message
Be aware, when using the php Header function to redirect from one domain to another, search engines will a (perhaps damaging) 302 temporarily redirect status code. I believe it would be better to make use of 301 Permanently redirects in those cases you won't need to go back to an old domain or any other old URLs. /* Bad way or only for temporarily redirects */ header("Location: http://www.venelogia.com/"); /* Good and permanent redirect */ header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.venelogia.com/"); exit(); As a side note, after I decided to move permanently to a new domain I started (in my ingenuity) using a normal PHP redirect from one domain to another but this caused many indexing problems. So... Avoid using simple (and common) 302 PHP redirects unless you really need to get back to certain URLs. Regards, Mel ---- Server IP: 69.147.83.197 Probable Submitter: 190.37.129.117 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/78088 Del: integrated -- https://master.php.net/note/delete/78088/integrated Del: useless -- https://master.php.net/note/delete/78088/useless Del: bad code -- https://master.php.net/note/delete/78088/bad+code Del: spam -- https://master.php.net/note/delete/78088/spam Del: non-english -- https://master.php.net/note/delete/78088/non-english Del: in docs -- https://master.php.net/note/delete/78088/in+docs Del: other reasons-- https://master.php.net/note/delete/78088 Reject -- https://master.php.net/note/reject/78088 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#130829) next »