etc map for multi domain in aem 6.5 | Community
Skip to main content
Level 2
November 18, 2021
Solved

etc map for multi domain in aem 6.5

  • November 18, 2021
  • 1 reply
  • 2520 views

Hi,

I have 2 domains for my dev environment for which I have created etc/map to shorten the content url.

etc map redirect for both domain is similar like this-

 

 

 

both domain has same sling:internalRedirect and redirect node.

but when I am generating sitemap.xml on domain am-dev.test.com (using acs common) all my generated pages having domain am-devwaf.test.com and not am-dev.test.com.

why is only one domain's etc/map is getting picked up for url shortening ?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Asutosh_Jena_

Hi @anoop345 

 

This is not feasible.

The etc/map settings does not match the origin header of the incoming request, and will stop on the first match it finds for the underlying content path. This is not much of a problem for incoming requests but becomes an issue for outgoing re-written links. e.g., if you have two settings for outgoing mapping i.e map1 for devwaf.test.com and map2 foram-am-dev.test.com both resolving to the content path /content/project/content then regardless of which domain the request comes from, the outgoing short URL will be of the first setting Sling will match for that content path, in this case map1 (whichever is first match. It can be anyone).

 

Please try redirect/mapping using dispatcher or webserver redirect it will help you achieve the use case.

 

Thanks!

1 reply

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
November 18, 2021

Hi @anoop345 

 

This is not feasible.

The etc/map settings does not match the origin header of the incoming request, and will stop on the first match it finds for the underlying content path. This is not much of a problem for incoming requests but becomes an issue for outgoing re-written links. e.g., if you have two settings for outgoing mapping i.e map1 for devwaf.test.com and map2 foram-am-dev.test.com both resolving to the content path /content/project/content then regardless of which domain the request comes from, the outgoing short URL will be of the first setting Sling will match for that content path, in this case map1 (whichever is first match. It can be anyone).

 

Please try redirect/mapping using dispatcher or webserver redirect it will help you achieve the use case.

 

Thanks!

Level 5
February 21, 2024

Hi Folks,

 

We have two domains(both are redirecting to same content tree internally) under etc/map folder. 

one is adobe publisher other is CDN. Sitemap is showing adobe publisher domain always even if sitemap was opened on cdn domain.

Facing this issue in AEM cloud. What is the fix for this, which dispatcher rewrite rules to update? 

Kindly advise if solution was implemented and tested.

 

Thanks,

Pradeep