PHP custom 404 with url as argument??
Posted: Fri Jun 18, 2010 8:21 am
Hello!
I spent a little time thinking about this but not sure if its possible or how to approach.
I want to create a custom error document like 404.php which will appear when a user goes to a non existing page on my server, but I would like it if there was an argument ($_POST or $_GET.. or another) which contained the url which the user originally tried to access? Does anyone know if this is possible?
I looked on google but no luck really.
My webserver is apache if that will help.
After I have this I can easily program the rest but the reason/end result I am hoping to achieve is that I will be able to redirect all requests from http://<domain1>/<something>/ to http://<domain2>/<something>.php
note: i want to do it on 404 because if the <domain1>/something EXISTS, I do NOT want to redirect.
Anyway I don't need help with that part... just the first part.
Is there some way to make a custom 404 doc which can get the attempted url?
thanks!
I spent a little time thinking about this but not sure if its possible or how to approach.
I want to create a custom error document like 404.php which will appear when a user goes to a non existing page on my server, but I would like it if there was an argument ($_POST or $_GET.. or another) which contained the url which the user originally tried to access? Does anyone know if this is possible?
I looked on google but no luck really.
My webserver is apache if that will help.
After I have this I can easily program the rest but the reason/end result I am hoping to achieve is that I will be able to redirect all requests from http://<domain1>/<something>/ to http://<domain2>/<something>.php
note: i want to do it on 404 because if the <domain1>/something EXISTS, I do NOT want to redirect.
Anyway I don't need help with that part... just the first part.
Is there some way to make a custom 404 doc which can get the attempted url?
thanks!