Trying to redirect a page to my custom 404 error document, but in vain.
Heres the code
header('HTTP/1.1 404 Not Found', true, 404);
But it stays on the same page even though the header information changes as required
HTTP/1.1 404 Not Found
Date: Wed, 09 Jan 2013 18:10:44 GMT
Server: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.8
PHP page continues and no redirect is achieved!
You should just do
header("Location: /errors/junk.php");as that’s essentially what Apache does with custom error documents, just on the server level instead of in PHP. I believe Apache uses a 301 redirect, but I could be wrong.