I have a 404.php file in my site\'s main directory and I was using header(\'Location: 404.php\'); for a while until someone said that you should use heade
header(\'Location: 404.php\');
heade
After writing
header('HTTP/1.0 404 Not Found');
add one more header for any inexisting page on your site. It works, for sure.
header("Location: http://yoursite/nowhere"); die;