Douglas Abernathy wrote:
You need to use the "header" function to send an HTML header line,
s/HTML header line/HTTP header/
which only works if it is sent prior to ANY HTML markup (even a space
character in the wrong place will trigger an error).
s/ANY HTML markup/any output/
File "OldHomePage.php":
<?php
header("Location: NewHomePage.php");
?>
The Location header field value must be "a single absolute URI"
(RFC2616, sec. 14.30), support for relative URIs notwithstanding.
Note the presence of a space character between the colon and the file name
of the new file
That space character isn't mandatory (RFC2616, sec. 4.2), although
it is "preferred", and such usage is well-established insofar as
it's been adopted by the HTTP standard itself. In fact, any amount
of linear white space (LWS) is permitted before a header field
value. However, semantically speaking, all LWS is equivalent to a
single space (RFC2616, sec. 2.2).
Just for completeness:
CR = <US-ASCII CR, carriage return (13)>
LF = <US-ASCII LF, linefeed (10)>
SP = <US-ASCII SP, space (32)>
HT = <US-ASCII HT, horizontal-tab (9)>
CRLF = CR LF
LWS = [CRLF] 1*( SP | HT )
Elucidating for the ABNF-challenged amongst us, LWS translates to:
an optional carriage-return linefeed sequence, aka "end-of-line
marker", followed by one or more spaces or horizontal-tabs.
--
Jock