mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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
This commit is contained in:
parent
65e1ce4d92
commit
0948cfe1fb
1 changed files with 19 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.26 $ -->
|
||||
<!-- $Revision: 1.27 $ -->
|
||||
<reference id="ref.http">
|
||||
<title>HTTP functions</title>
|
||||
<titleabbrev>HTTP</titleabbrev>
|
||||
|
@ -60,6 +60,24 @@ exit; /* Make sure that code below does
|
|||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
HTTP 1.1 requires an absolute URI as argument to
|
||||
<ulink url="&spec.http1.1;/rfc2616-sec14.html#sec14.30">Location:</ulink>
|
||||
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 <function>dirname</function>
|
||||
to make an absolute URI from a relative one yourself:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
Header ("Location: http://".$HTTP_SERVER_VARS['HTTP_HOST']
|
||||
."/".dirname($HTTP_SERVER_VARS['PHP_SELF']
|
||||
."/".$relative_url);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The second special-case is any header that starts with the
|
||||
string, "HTTP/" (case is not significant). For
|
||||
|
|
Loading…
Reference in a new issue