Re: the issue of not getting a 404:
Here's what I use:
PHP Code:
header("HTTP/1.0 404 Not Found");
exit();
exit() makes sure nothing else goes out after the 404 header.
Also you must ensure that nothing gets sent to the browser
before the header() call. Look for echo() and print() before the header() calls.
As to sending the user to a good page after a few seconds, I don't think that's possible with a real 404. You could send them to a real page that says 'Page not found' and add a javascript timer to send them to a better page after few seconds.
PHP Code:
header('Location: my404.html');
exit();
The javascript would be something like:
Code:
<script type="text/javascript">
setTimeout("window.location='someBetterPage.html'",10000);
</script>