Details
-
Bug
-
Resolution: Won't Fix
-
Neutral
-
None
-
5.4.1
-
None
-
None
-
Magnolia 5.4.1 CE
Description
I think I found a bug with Magnolia's HostBasedRegexpVirtualURIMapping. I am using Magnolia 5.4.1 CE.
I have the following pages:

and the following mapping configured:

My intention is that a request to:
http://www.area1.local:8888 /magnoliaAuthor/subarea/home
gets forwarded to the page: /area1/subarea/home
while a request to:
http://www.area2.local:8888/magnoliaAuthor/subarea/home
gets forwarded to the page: /area2/subarea/home
However, it does not work, the forwarding does not take place.
Looks like a bug in HostBasedRegexpVirtualURIMapping to me.
Interestingly, the following cases work though:
Alternative 1:
I change the `fromURI` to `/subarea/(.*).html` like this:

and then, a request to
http://www.area1.local:8888/magnoliaAuthor/subarea/home.html
gets forwarded to the page: /area1/subarea/home
However, I do not want to use the ".html" in the url.
Alternative 2:
Second option that works as well is using the HostBasedVirtualURIMapping instead of the HostBasedRegexpVirtualURIMapping, but of course, this approach is a bit tiring to configure for each url.

This makes my URI mapping work as intended, but I do not want to configure every possible fromURI but would rather like to use regular expressions.