I have a self-built MVC fw with a router routing URLs such that the common example.com/controller/action
is used. I'm running into issues when my application is deployed within a sub-directory such as
example.com/my_app/controller/action/?var=value
My router thinks my_app
is the name of the controller now and controller
is the method.
My current solution is to manually ask for any sub directory name in a config at install. I'd like to do this manually. See my question below and let me know if I'm going about solving this the wrong way and asking the wrong question.
My question: if I have two paths, how do I truncate the common pieces from the end of one and remove it from the end of the other.
A = /var/www/my_app/pub B = /my_app/pub/cntrl/actn
What's your quickest one liner to remove /my_app/pub from B and remain with /cntrl/actn? Basically looking for a perl-esque way of getting the common denominator like string.
Thanks for any input