#33266 [Fbk->Bgs]: Response header sent as 302 dispite being set to 301

From: Date: Wed, 08 Jun 2005 06:56:21 +0000
Subject: #33266 [Fbk->Bgs]: Response header sent as 302 dispite being set to 301
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-80030@lists.php.net to get a copy of this message
 ID:               33266
 Updated by:       rasmus@php.net
 Reported By:      nkulbiski at ogdenpubs dot com
-Status:           Feedback
+Status:           Bogus
 Bug Type:         IIS related
 Operating System: windows 2000
 PHP Version:      5.0.3
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2005-06-08 00:24:13] sniper@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip



------------------------------------------------------------------------

[2005-06-07 23:40:19] 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.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33266&edit=1


Thread (3 messages)

« previous php.bugs (#80030) next »