From: mitja@doticni.net
Operating system: any
PHP version: 4.0.6
PHP Bug Type: Feature/Change Request
Bug description: prepending protocol and hostname to location: headers
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 bug report at: http://bugs.php.net/?id=13991&edit=1