What would be the best way to show a Default 404. The one which the server generates.
I assume you're using the Apache Webserver second version (probably this needs 2.2 or higher).
To get the wbeservers default 404 page do a redirect with the 404 code. This works in multiple places (for example in mod_rewrites' RewriteRule
with R=404
flag at the very end):
But also for other directives with redirect that allow you to pass the redirect code.
For example the Redirect
directive (second line from end):
# mask 403 on .ht* as 404
<Files ~ "^\.ht">
Order Deny,Allow
Allow from all
Satisfy All
Redirect 404 /
</Files>
The you commented:
I want to do this from within the PHP file if possible.
AFAIK sending an internal redirect is not possible from PHP. You can try to figure out which the default response is - and in case it is from a static HTML file - include that file from within PHP.