From 0948cfe1fb01d8e1ff8939681019d5c31958ec19 Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Sat, 22 Sep 2001 08:39:02 +0000 Subject: [PATCH] added a note regarding Location: headers and relative URIs git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@58045 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/http.xml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/functions/http.xml b/functions/http.xml index 7afa59d841..be3f523c41 100644 --- a/functions/http.xml +++ b/functions/http.xml @@ -1,5 +1,5 @@ - + HTTP functions HTTP @@ -60,6 +60,24 @@ exit; /* Make sure that code below does + + + HTTP 1.1 requires an absolute URI as argument to + Location: + including protocol, hostname and absolute path. Some clients + might accept relative URIs but you definetly should not rely on + it. You can usually use $HTTP_SERVER_VARS['HTTP_HOST'], + $HTTP_SERVER_VARS['PHP_SELF'] and dirname + to make an absolute URI from a relative one yourself: + + +Header ("Location: http://".$HTTP_SERVER_VARS['HTTP_HOST'] + ."/".dirname($HTTP_SERVER_VARS['PHP_SELF'] + ."/".$relative_url); + + + + The second special-case is any header that starts with the string, "HTTP/" (case is not significant). For