There may be several HTTP headers of the same type in a web page. By default, the second HTTP header will replace the first. But if the
<?PHP header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 301 Moved Permanently"); header("HTTP/1.0 408 Request Time-out"); ?>
<?PHP header("LOCATION: index.php"); header('cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0',false); ?>
You may set up a specific wait time before the redirection. During the wait, content after
<?PHP header("refresh:4; url=index.php"); echo "Please wait, you will be redirect to a new page ...\n"; ... ?>
To use variables in the redirection:
<?PHP $url="index.php"; header("LOCATION: http://www.endmemo.com/$url"); ?>
If you have "&" and variables in the redirection, the variables should be concatenated with the url string to avoid confusion:
<?PHP $p1="a"; $p2="b"; header('LOCATION: xxx.php?p1=".$p1."&p2=".$p2'); ?>
<?PHP header('cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0',false); header('Pragma: no-cache'); ?>
<?PHP header("Content-Type:application/octet-stream"); header("Content-Disposition: attachment;"); header("Accept-ranges: bytes"); ?>
For more information, visit HTTP Headers.