title: How to display default Apache 404 from PHP
body: <p>I have looked around, and haven't found any questions regarding what I need.</p>
  
  <p>I would like to make something like an "admin.php", but I would like to make it where it returns a 404 if the conditions aren't right. However, a 404 that looks different from all the rest of the 404 pages will hint to the attacker that "admin.php" is a real file.</p>
  
  <p>I don't want to make my own custom 404 page, I think Apache's default 404 is good enough for me. How do I send a 404 that triggers apache to send the already ErrorDocument. I assume this error document, after searching for it, is located (in Ubuntu): "/usr/share/apache2/error/HTTP_NOT_FOUND.html.var"</p>
  
  <p>When I use things like:</p>
  
  <pre><code>&lt;?php
      http_response_code(404);
      die();
  ?&gt;
  </code></pre>
  
  <p>it looks like this in the web browser:</p>
  
  <p><a href="https://i.stack.imgur.com/B14D0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/B14D0.png" alt="enter image description here"></a></p>
  
  <p>When I request a URL that truly isn't on the web server it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/SeF8B.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SeF8B.png" alt="enter image description here"></a></p>
  
  <p>I would like to know how I could make the "/admin.php" look like the second image, using Apache's default 404 page. Is there a way to do this without using .htaccess files, just from PHP? If not, I'll just have to figure out how to mess with Apache settings then.</p>