Currently the sling mappings generated by aem-definitions for a tenant is like this:
This works fine for the tenant itself. However other tenants that have their own domain but no sling mapping (no URL shortening) get a problem. If a tenant has no sling mapping, all their URLs get rewritten with the last domain in the mapping table. This is because the last entry in the mapping table is the root path "/" which matches to every path. The sling mapper uses in this case the last domain
For example if the page http://myothersite.com/content/myothersite/en.html has a link like this
it's URL is rewritten to http://example.com/content/myothersite/en/contact.html which is obviously the wrong domain
This is specially the case on testing and staging systems where multiple tenants are deployed but not all of them need URL-shortening.
We must not generate any external mappings for the root path.
Following configurations would solve this error. I prefer option 2 because of clearer hierarchy.