Hi Everyone,
We have a requirement where we need to create Resource Resolver mapping or other solution that will helps us get the appropriate shorten url for the same content when accessed through different subdomains. For example:
We have a content path /content/mysite/mypage.html
And we have 2 domains abc.mysite.com and xyz.mysite.com. mypage.html contains links to other internal resources(pages etc.). Our components use ResourceResolve.map() to create the necessary absolute shorten URL.
We have created a mapping in /etc/map for both abc.mysite.com and xyz.mysite.com like this:
--https
abc.mysite.com
content
sling:internalRedirect:/content/mysite/
xyz.mysite.com
content
sling:internalRedirect:/content/mysite/
This works fine for abc.mysite.com but not for xyz.mysite.com. In other words if we access abc.mysite.com we get the internal page and the links to other pages on it are https://abc.mysite.com/.... but if we access the page from xyz.mysite.com again the links on it are https://abc.mysite.com/....
From what I understand since there are 2 mappings for the same path (/content/mysite/) the mapping naturally picks the first one (for abc.) and ignores the second one. How can we achieve the necessary result, which would be to have links on a page accessed through one subdomain have the same subdomain. I know we can alter the links in the backend but we were looking for a solution via /etc/map.
Thank you!