Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

etc map for multi domain in aem 6.5

Avatar

Level 2

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-

Anoop345_0-1637222852998.png

Anoop345_1-1637222924515.png

Anoop345_2-1637223264084.png

Anoop345_3-1637223328727.png

 

 

 

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 ?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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!

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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!

Avatar

Level 6

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