I wrote a 404 error page and I have been able to redirect to that page but I want to load it inside the current page. I'm not sure how much sense I am making but I want to stay on the same page with the same link but show the content from the notfound.php page. My reason for this is that the page I wrote looks at the link and corrects a common error. I used to have a forum at mysite.com/forum but it was since moved to be on just mysite.com but since people frequently are linked to mysite.com/forum/topic I wrote a php script that will redirect them to mysite.com/topic solving the error without me trying to trace all links and get the authors to fix them.
For my script to work I need to maintain the url that caused the 404 error but I need my code to be run. So it has to be the same page. I know this is possible because if you go to apple.com/Iamapagethatdoesn'tactuallyexist you get their error page without redirecting. My host has a simple error page editor that keeps you on the page but it only lets you run a .shtml page so my php scripts will not run.
For my script to work I need to maintain the url that caused the 404 error but I need my code to be run. So it has to be the same page. I know this is possible because if you go to apple.com/Iamapagethatdoesn'tactuallyexist you get their error page without redirecting. My host has a simple error page editor that keeps you on the page but it only lets you run a .shtml page so my php scripts will not run.