In my project, I'm routing all requests to index.php. Then I check $_SERVER['REQUEST_URI']
against a whitelist and display the relevent content.
Now, if the $_SERVER['REQUEST_URI']
does not match anything in my whitelist, I display some "page not found" text. In effect, it is a custom 404 error page.
My question is: do I need to write header('HTTP/1.0 404 Not Found');
before I output my HTML? What does it actually do? My error page is displayed regardless so is it important in this scenario?