title: Access apache errordocument directive from PHP
body: <p>I would like to make a php script output like a real 404 page (as set in the Apache ErrorDocument directive) if certain conditions are not met. I'm not sure how I can / if it's possible to access this value from PHP..</p>
  
  <pre><code>if(!@$_SESSION['value']){
   header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
   echo $default_page['404'];
   exit();
  }
  echo 'Welcome to a secret place.';
  </code></pre>
  
  <p>I understand the ErrorDocument value can be overwritten, but I'm particularly interested in the 'default' value hardcoded by Apache. If it's possible to know the value which is overwitten (eg by a .htaccess file), then that's a bonus :)</p>
  
  <p><a href="http://httpd.apache.org/docs/2.0/mod/core.html#ErrorDocument" rel="nofollow">http://httpd.apache.org/docs/2.0/mod/core.html#ErrorDocument</a></p>
  
  <p>edit: to be clear, I'd like to send the content the default 404 page (or 403, etc) of Apache from PHP. If I only use <code>header</code> on its own then nothing is output to the client/user (at least in FF/Chrome, IE has its own built in pages which are shown). </p>