Need help with a problem that has been bothering me for some time!
I am attempting to create an Apache AliasMatch
Regular Expression that will match a URL. The Issue I'm having is that I am using the capture groups as variables $0 $1 $2
within the file match portion. Essentially I need to capture the path/to/controller
portion of the url to actually grab my file and I wish to not use any capture groups after and including the double forward slashes.
http://domain.com/etc/xx/abc/path/to/controller//myDesiredMVCAction
The issue Essentially is that with the following expression:
^/etc/(xx|yy)/(abc|xyz)/(.*)(?=//)(.*)
it only matches
http://domain.com/etc/xx/abc/path/to/controller//myDesiredMVCAction
and not:
http://domain.com/etc/xx/abc/path/to/controller
given that the double slashes and everything trailing it is optional.
So when I make the regex expression optional by appending a ?
it ruins the capture group by including the //myDesiredMVCAction
portion..
^/etc/(xx|yy)/(abc|xyz)/(.*)(?=//)(.*)?
It is possible to achieve what I'm after?