Your apparent file structure:
/
.htaccess
request.php
...
errors/
junk.php
.htaccess
ErrorDocument 404 /errors/junk.php
request.php
header('HTTP/1.1 404 Not Found', true, 404);
echo "Despite the 404 header this ~file~ actually exists as far as Apache is concerned.";
exit;
errors/junk.php
header('HTTP/1.1 404 Not Found', true, 404);
echo "The file you're looking for ~does not~ exist.";
echo "<pre>" . var_export($_SERVER, TRUE) . "</pre>";
exit;
http://yoursite.com/request.php will show:
Despite the 404 header this ~file~ actually exists as far as Apache is concerned.
http://yoursite.com/filethatdoesntexist.php will show:
The file you're looking for ~does not~ exist.
[a dump of $_SERVER which may be helpful in writing custom 404 handler code]
If you have a file that exists, but you want it to pretend it's a 404 you can either write the redirect in PHP as:
header('Location: http://mysite.com/errors/junk.php');
exit;
Which will redirect the browser to the full URL, or simply:
include('errors/junk.php');
exit;
Which will leave the user at the same page URL, but present your error code.