I've run into a problem that I can't figure out the best way to solve.
I have a 404.php page with a customized message. This page works fine for 404 and other server errors, but if the user links to a "post" or "page" that does not exist. The web server doesn't throw an error. Instead it goes to the loop with in index.php of my theme which then finds nothing to display and prints out a different message.
Rather than recreate the code for 404.php with in index.php I'd like to redirect the user to 404.php. But you can't do this easily with php because content has already been output at this point, so php won't let you modify the headers.
Has anyone out there come up with a good solution to this?
Thanks in advance,