Search code examples
phpconsolehttp-status-code-404hide

Hide 404 error if url contains specific word / PHP


Is it possible to hide the 404 Error in the console if the url contains a specific word?


Solution

  • I'm assuming that you're basically hijacking the 404 page so you can have dynamic URLS, which means you'll need to invoke the following before you start sending the actual content.

    header("HTTP/1.1 200 OK")