Bug #13991: prepending protocol and hostname to location: headers

From: Date: Thu, 08 Nov 2001 16:40:52 +0000
Subject: Bug #13991: prepending protocol and hostname to location: headers
Groups: php.dev 
Request: Send a blank email to php-dev+get-69803@lists.php.net to get a copy of this message
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



Thread (2 messages)

« previous php.dev (#69803) next »