cvs: /phpdoc/en/functions http.sgml
| From: | Rasmus Lerdorf | Date: | Sun, 28 Nov 1999 22:17:10 +0000 |
| Subject: | cvs: /phpdoc/en/functions http.sgml | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-13243@lists.php.net to get a copy of this message | ||
rasmus Sun Nov 28 17:17:10 1999 EDT
Modified files:
/phpdoc/en/functions http.sgml
Log:
Make sure the fact that Location and HTTP/ headers are actually special
cases is documented.
Index: phpdoc/en/functions/http.sgml
diff -u phpdoc/en/functions/http.sgml:1.8 phpdoc/en/functions/http.sgml:1.9
--- phpdoc/en/functions/http.sgml:1.8 Sun Nov 14 20:44:24 1999
+++ phpdoc/en/functions/http.sgml Sun Nov 28 17:17:09 1999
@@ -31,11 +31,26 @@
auto_prepend and have spaces or empty lines in this code that force
output before <function>header</function> is called.</para>
- <para>
+ <para>
+ There are two special-case header calls. The first is the "Location"
+ header. Not only does it send this header back to the browser, it also returns
+ a REDIRECT status code to Apache. From a script writer's point of view this
+ should not be important, but for people who understand Apache internals it is
+ important to understand.
<informalexample><programlisting role="php">
header("Location: http://www.php.net"); /*
Redirect browser to PHP web site */
exit; /* Make sure that code below does not get executed when we redirect. */
</programlisting></informalexample></para>
+ <para>
+ The second special-case is any header that starts with the string, "HTTP/"
+ (case is not significant). For example, if you have your ErrorDocument 404 Apache
+ directive pointed to a PHP script, it would be a good idea to make sure that your
+ PHP script is actually generating a 404. The first thing you do in your script should
+ then be:
+ <informalexample><programlisting role="php">
+header("http/1.0 404 Not Found");
+ </programlisting></informalexample>
+ </para>
<para>
PHP scripts often generate dynamic HTML that must not be cached