Right way of using short URL for multiple domains
Hello Team,
There are lots of information available for the short URL implementation. Wanted to know the right approach.
My scenario:
My project handles various domains. each content hierarchy supports various domain site.
abc.com
/content/client/abc/en
xyz.com
/content/client/xyz/en
pqr.com
/content/client/pqr/en
Short URL is handled via Apache Sling Resource Resolver Factory, Dispatcher configuration
In the Apache Sling Resource Resolver Factory configuration, we have added these values for publish env. run mode ( only for prod publish)
^/content/client/abc/(.+).html</$1.html
^/content/client/xyz/(.+).html</$1.html
^/content/client/pqr/(.+).html</$1.html
Then, in the Dispatcher, for each domain, we have separate redirect conf file.
So, in each file we have written these line for the re direction
RewriteRule ^/$ /en/home.html [R=301,NC,L]
This works perfect for all our sites. Even in any component, if we use internal page path then while on hovering the link, this shows short URL. This is good one.
However, I have noticed that short URL is enabled in prod publish environment. In this case, if I click on any menu(where we are showing the page hierarchy as menu, menu item), this goes to short URL. and then shows 404 response. Then, manually I need to use the long URL.
Anyhow, this is not a major blocker. Since, authors, testers use Prod author, then live site URL. Only developers are using prod publish for testing few pages.
Is this, the right approach? Can I utilize Sling Mappings – under etc/map
Checked these sites. But, still have confusion.
https://helpx.adobe.com/in/experience-manager/kb/multi-domain-management-aem-mappings-for-url-shortening---aem-6-.html
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-url-shortening-functionality/m-p/305586