I\'d like to use the following to redirect pages that are no longer present in the database to the custom 404 page:
ob_start(); .... if ( !$found ): header
I've tried and make sure to check error_log file that is correct way is send 404 headers and then include error page to next line.
Finally you have to use exit() for text based browsers.