Does anyone know how to use the 404 page as a way to display a different template and url in the address bar?
Let me explain.
My website is dynamic, the hrefs and the content are generated from the database. I pass a Get variable on the links, kinda like /index.php?pid=4 to to get the right content from the database.
Instead of using ?pid=4 i want to use /contact, a page that doesnt exist on the server.
Somehow instead of the 404.html page loading, the server runs index.php that querys the database to see if the variable 'contact' exists.
It sees that it does and loads index.php as normal, however in the browser adderss it shows as /contact
I want to get rid of ?pid=4 and replace it with the page name as a variable and use the 404 page trigger the code.
Does anyone know how to do this?
Do you have to edit the .htaccess file to do it?