title: How to create an error 404 page using PHP?
body: <p>My file <code>.htaccess</code> handles all requests from <code>/word_here</code> to my internal endpoint <code>/page.php?name=word_here</code>. The PHP script then checks if the requested page is in its array of pages.</p>
  <p>If not, how can I simulate an error 404?</p>
  <p>I tried this, but it didn't result in my 404 page configured via <code>ErrorDocument</code> in the <code>.htaccess</code> showing up.</p>
  <pre><code>header($_SERVER[&quot;SERVER_PROTOCOL&quot;].&quot; 404 Not Found&quot;);
  </code></pre>
  <p>Am I right in thinking that it's wrong to redirect to my error 404 page?</p>