Is it possible to make .htaccess "understand" dynamic relative paths and redirect them correctly?
My setup is as follows:
http://domain.com/htroot/aaa/xyz http://domain.com/htroot/bbb/xyz http://domain.com/htroot/ccc/xyz
Etc. For example, "htroot" contains the .htaccess, which I need to change. The following sublevels (aaa, bbb, ccc) can be any name a-z0-9, and folders have index.php (or any other .php that needs to be redirected). xyz should work as a gender parameter, see the next part. The xyz part is nowhere in the file system as a “physical” folder or file.
I need to achieve the following: when you access from a URL
http://domain.com/htroot/aaa/xyz
he receives content from
http://domain.com/htroot/aaa/ (or http://domain.com/htroot/aaa/index.php, either way)
where index.php kicks into →, I can get xyz processed with REQUEST_URI and process it to serve the correct content that it sets, while the URL of the page remains http://domain.com/htroot/aaa/xyz , naturally.
So far I have managed to remove this if each sublevel (aaa, etc.) has its own .htaccess, but I need one where there is only one .htaccess located in htroot that handles this. I suppose this may have something to do with the $ 0 options in .htaccess, but not sure.
source share