PHP auto_prepend and http 404 errors
<p>I have Apache and PHP setup and i am using a <code>.htaccess</code> file to auto_prepend a file to any output.</p>

<p>The problem is when I want to output a 404 error using </p>

<pre><code>&lt;?php header("HTTP/1.0 404 Not Found"); ?&gt;
</code></pre>

<p>It still outputs the header as the auto_prepended file has already been processed.</p>

<p><code>.htaccess</code> file</p>

<pre><code>php_value date.timezone 'Europe/London'
php_value auto_prepend_file load.php
</code></pre>

<p><code>load.php</code></p>

<pre><code>&lt;?php

    // Set the error reporting level (DEV)
    error_reporting(E_ALL);
    ini_set("display_errors", 1);

    // Load the configuration file
    include("config/config.php");

    session_start();

?&gt;
</code></pre>

<p>So the load file includes the include for the config file so that it is set on every page that loads.</p>

<p>So at the moment I have some pages which are giving soft 404 errors rather than actual 404 errors, so if there is no data returned for say browsing to /image/123 because image 123 doesnt actually exist, I output a "This image doesnt exist" so this then causes problem for google or any other crawler as it can keep going from /image/123 .... /image/12222222333333444444 etc... So it actually needs to output a proper 404.</p>

<p>Hope someone can help.</p>
