"virtual path" / path translation on Apache + PhP
Posted: Wed Mar 03, 2010 2:10 am
Not sure whether it is more related to Apache or PhP, but is there a way that I can use a common handler to handle all the requests, if the URL is not found? (something similar to the dhandler in perl/mason)
What I am trying to do is:
I want to setup a kind of URL "translator", for example,
Given a request to URL like http://www.myhost.com/a1/a2/a3.php, I actually want http://www.myhost.com/b1.php to handle it (of course, I don't want the client to know it -- I do not want to simply redirect the request to the actual location).
Given another request to URL like http://www.myhost.com/c1/c2/c3.php, I actually want http://www.myhost.com/d4/d5.php to handle it.
Of course, we can assume there are some kind of rules for the url translation.
Any idea of this?
Thanks a lot.
What I am trying to do is:
I want to setup a kind of URL "translator", for example,
Given a request to URL like http://www.myhost.com/a1/a2/a3.php, I actually want http://www.myhost.com/b1.php to handle it (of course, I don't want the client to know it -- I do not want to simply redirect the request to the actual location).
Given another request to URL like http://www.myhost.com/c1/c2/c3.php, I actually want http://www.myhost.com/d4/d5.php to handle it.
Of course, we can assume there are some kind of rules for the url translation.
Any idea of this?
Thanks a lot.