Forum Moderators: coopster
<?php
header("Location: http://www.mydomain.co.nz/mydir");
header("Status: HTTP/1.1 301 Moved Permanently");
?>
Server Response: http://www.mydomain.co.nz
Status: HTTP/1.1 302 Found
Date: Wed, 18 Jun 2003 22:04:36 GMT
Server: Apache/1.3.27 (Unix) mod_log_bytes/1.2 mod_bwlimited/1.0 PHP/4.3.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b
X-Powered-By: PHP/4.3.1
Status: HTTP/1.1 301 Moved Permanently
Location: http://www.mydomain.co.nz/mydir
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set.