|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-06-07 23:40 UTC] nkulbiski at ogdenpubs dot com
Description:
------------
This should return a response header of 301, but sends a response header of 302.
Reproduce code:
---------------
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://{$_SERVER['HTTP_HOST']}/library/{$redirect[0]['full_safe_name']}");
header("Connection: close");
Expected result:
----------------
I expected a response header of 301 and the page to be redirected to the new url.
Actual result:
--------------
It did redirect to the new url but send a responce header of 302.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 08:00:02 2025 UTC |
The way to do that is not with 2 header calls like that. Location defaults to a 302 unless you tell it otherwise like this: header("Location: http://example.com", true, 301);