TransWikia.com

DXA - Resolving Publication mapping incorrectly when having multiple websites

Tridion Asked by Saurabh Mehndiratta on October 1, 2021

We have 2 websites (brands) with different domains.

In Topology, the 2 websites are configured with base urls as : http://domain1 and http://domain2
And mapping for UK publication exists only in domain1

PublicationId       : tcm:0-307-1
EnvironmentPurpose  : Purpose-Live
WebApplicationId    : DOMAIN1_LIVE_WEBSITE_RootWebApp
RelativeUrl         : /uk
PrimaryMappedUrl    : http://domain1/uk
IsOffline           : False
CdEnvironment       :
Id                  : Live_Mapping_307

But when I try to get Publication for domain2 in Content service using GetPublicationMappingsFunctionImport (via Postman) – It gets resolved to 307. This should not return any mapping.

http://localhost:8481/client/v4/content.svc/GetPublicationMappingsFunctionImport(Url='http://domain2/uk')

Is there any way to configure Content service (or Discovery) to do an exact match of Website + WebApplication + Mapping to resolve PublicationMapping ?

Get-TtmWebsite cmdlet output:

BaseUrls             : {http://domain1}
CdEnvironmentId      : Live
EnvironmentPurpose   : Purpose-Live
CdEnvironment        :
ScopedRepositoryKeys : {}
Id                   : DOMAIN1_LIVE_WEBSITE
ExtensionProperties  : {}


BaseUrls             : {http://domain2}
CdEnvironmentId      : Live
EnvironmentPurpose   : Purpose-Live
CdEnvironment        :
ScopedRepositoryKeys : {}
Id                   : DOMAIN2_LIVE_WEBSITE
ExtensionProperties  : {}

Get-TtmMapping output:

CmEnvironmentId     : CME
PublicationId       : tcm:0-307-1
EnvironmentPurpose  : Purpose-Live
WebApplicationId    : DOMAIN1_LIVE_WEBSITE_RootWebApp
RelativeUrl         : /uk
PrimaryMappedUrl    : http://domain1/uk
IsOffline           : False
CdEnvironment       :
Id                  : Live_Mapping_307


CmEnvironmentId     : CME
PublicationId       : tcm:0-349-1
EnvironmentPurpose  : Purpose-Live
WebApplicationId    : DOMAIN2_LIVE_WEBSITE_RootWebApp
RelativeUrl         : /us
PrimaryMappedUrl    : http://domain2/us
IsOffline           : False
CdEnvironment       :
Id                  : Domain2_Live_Mapping_307
ExtensionProperties : {}

We also have similar mappings for both domain1 and domain2 (like /uk in domain1 and /uk/en in domain2), but there are few which are specific to domain1 only (for example: /global, or /worldwide) which do not exist for domain2.

But when requesting for PublicationMapping, like this
http://localhost:8481/client/v4/content.svc/GetPublicationMappingsFunctionImport(Url=’http://domain2/global’) – we get response of mapping that exist for domain1.

Tridion- 8.5
DXA – 2.0 Java

One Answer

Have you tried to use context URLs instead on relative URLs when you setup topology?

I have faced a similar issue with 8.5 since one of the content delivery jars sorts the first hit from the mappings based on the pattern search. I used context URLs to resolve the issue. SDL may have a hotfix now.

Answered by Shiva on October 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP