Externalizer page path impacted due to alias | Community
Skip to main content
Level 2
June 21, 2022
Solved

Externalizer page path impacted due to alias

  • June 21, 2022
  • 1 reply
  • 628 views

Hi Team,

 

I was trying to form an external url based on custom domain;  Please see the below format.

 

// custom configured domain
 externalizer.externalLink(resolver, "mydomain", "https", "/content/site/en/page1", ) + ".html";
// => "https://mydomain.com/site/en/page1.html" (I was expecting this as an outcome)
// => "https://mydomain.com/site/en_gb/page1.html" (But I received this)

 After checking a few areas, I found that  "/content/site/en" has couple of alias and "en_gb" is one of them. So, does it mean every time on using external link, the top alias will be accounted if the resolved page hierarchy is encountering any set of alias. If I remove "en_gb" from alias set, then the same request was giving me "en_us" next time. 

 

So, it'll be great to know if there'll be any way to avoid / exclude alias when trying to form external link.

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 arunpatidar

Hi,

I think, this is happened because externalizer uses ResourceResolver.map(...) and resource resolver considering alias 

 

Can you try unchecking Optimize alias resolution from below osgi configuration in local and check

Apache Sling Resource Resolver Factory (org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl)

 

I would not suggest to updating this in PROD. The above change is just for testing.

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
June 21, 2022

Hi,

I think, this is happened because externalizer uses ResourceResolver.map(...) and resource resolver considering alias 

 

Can you try unchecking Optimize alias resolution from below osgi configuration in local and check

Apache Sling Resource Resolver Factory (org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl)

 

I would not suggest to updating this in PROD. The above change is just for testing.

Arun Patidar