Bug #13991 Updated: prepending protocol and hostname to location: headers
| From: | derick@php.net | Date: | Thu, 08 Nov 2001 17:59:40 +0000 |
| Subject: | Bug #13991 Updated: prepending protocol and hostname to location: headers | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-69811@lists.php.net to get a copy of this message | ||
ID: 13991
Updated by: derick
Reported By: mitja@doticni.net
Old Status: Open
Status: Closed
Bug Type: Feature/Change Request
Operating System: any
PHP Version: 4.0.6
New Comment:
IT would require a whole new parser, just to do this. And it is not really hard to code such a
function in PHP itself.
Also note that header is meant to set raw HTTP headers, and this would change that behavior.
I'm closing this, as I see no use for this, except for a little convenience.
Derick
Previous Comments:
------------------------------------------------------------------------
[2001-11-08 11:40:52] mitja@doticni.net
Would it be possible that when issuing header("Location: ...") the protocol and host name
would automagically be prepended, if it was missing. Since it's handled specially anyway, it
perhaps wouldn't be such a problem?
So
header("Location: /index.html")
would be the same as
global $HTTP_HOST, $HTTPS;
if ($HTTPS=="on")
header("Location: https://$HTTP_HOST/index.html");
else
header("Location: http://$HTTP_HOST/index.html");
(in apache anyway)
It would mean less typing for the programmer, forced compliance with HTTP/1.1 and it would work for
both http:// and https:// which now have to be handled
separately.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13991&edit=1