Expand my Community achievements bar.

SOLVED

ETC Mapping for two domains with same content

Avatar

Community Advisor

Hi All

       Can we do etc mapping for the same content to point to two different domains. ?

     Let's say I have  http://abc.com and http://xyz.abc.com ; I want to serve the same content(/content/a/b/c) using both the domains . Is it really feasible. We tried and are seeing some issues over it. Only one of them is getting resolved

Thanks

Veena

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi Veena,

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 www.abc.com and map2 for www.xyz.abc.com both resolving to the content path /content/a/b/c  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.

Please try redirect/mapping using dispatcher or webserver redirect.

View solution in original post

4 Replies

Avatar

Correct answer by
Former Community Member

Hi Veena,

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 www.abc.com and map2 for www.xyz.abc.com both resolving to the content path /content/a/b/c  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.

Please try redirect/mapping using dispatcher or webserver redirect.

Avatar

Level 1

digitalect-expert

When  you said E.g. if you have two settings for outgoing mapping  i.e  map1 for www.abc.com and map2 for www.xyz.abc.com both resolving to the content path /content/a/b/c  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.

How do Sling take one mapping to be first and the other as second?

Is it purely based on the order in which "sling:mapping" type nodes  are listed under a  domain?

Avatar

Level 2

Does someone have answer for the order of settings sling picks for same content path?

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----