PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
We have a script that takes pages that don't exist to a custom error page - index.php?page=error.
But this is causing google issues as it is caching the dead pages because they just direct internally.
I want to design the error_docs pages, but I don't know how to point a page that doesn't exist, to the error pages?
It says not to redirect. So do I use a window.script to point to the error page, and within that, add the code you give for 'header' into it?
In other words - does it go from the page that doesn't exist to the error page to the 404 ??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
I think you are getting confused my the word "page" here. The user requests a URL (which is called a page) and you return a HTML document (which is called a page) and one or more a PHP scripts may have generated that HTML "page". So a HTML document with a 404 HTTP header is the response to URLs for which the site does not have valid response for.
simonmlewis wrote:So do you "fake" the combined PHP page to make it appear as a 404 ?
You don't fake anything. The browser sends a request URL to the server. Your Front Controller determines if it can load code to generate a response to that request URL -- or not. If it cannot, then respond with a HTML page and a 404 HTTP header.