DrByte;595939]I don't know what you're meaning by "opens in a new window". There's nothing in the PHP redirect Location call that tells it to open in a new window.
Any page I tried in Location call
i.e.
/*
* redirect to the page_not_found page after sending spiders the "moved" message
*/
header("HTTP/1.1 301 Moved Permanently");
header("Location: CUSTOM.htm");
?>
resulted in opening a new (separate) browser window. Of course I did test with index.php there as you are suggesting here and it did work but the whole point for me was to display there my custom.htm 404 page...
I've been trying to let you figure out workarounds on your own, yet it appears I must spell it out for you.
This hurts... but you got me motivated to find a creative solution and to solve my problem so THANKS! I created a new EZ Page with desired custom 404 text and my new page_not_found.php file looks now like this:
header("HTTP/1.1 301 Moved Permanently");
header("Location: index.php?main_page=page&id=16&chapter=0");
Now it does everything I needed: sends 301 to robots, communicates to customer what I want it to communicate and looks nice within the car structure (not opening newbrowser's window).
Another question: why are people hitting page-not-found on your site anyway? Do you have a whole bunch of bad links to your site out there somewhere?
Why are you spending so much time on this topic? Maybe there's an even greater problem that should be solved in a more efficient way than setting up a page-not-found catch-all?
Before it was a ZenCart store -it was operating on standard html based code for quite some time. Since all files were replaced w/ Zen files our old invalid links are still out there. They are slowly being removed by serach engines but some of them keep coming back. The page_not_found redirect, I feel, will help to get rid of the old listing much faster. So in short this is an old problem and not a new problem.
Finally, I went ahead and replaced $this_is_main_page string in my ICAcademe's /common/tpl_main_page.php file with $this_is_home_page string as you suggested. It doesn't seem to make any difference to functionality but it is consistent with the rest of the site's codes.