I've got this odd issue with our Sitecore 10.2 with SXA implementation. I have a site definition that has multiple host names associated with it. On occasion, the links on the site will include the hostname of something other than the hostname you are browsing the site under. I'll give the specifics below.

SXA Site definition has the following for hostnames field:

  • sitea.mysite.com
  • sitea-staging.mysite.com
  • nameofappservice.azurewebsites.net

All the hostnames are supposed to hit the same site and are used for different purposes between external production, staging slot, or azure healthcheck.

Sometimes when browsing the site via sitea.mysite.com, after clicking around some of the links will display with the hostname of the nameofappservice.azurewebsites.net or sitea-staging.mysite.com instead of using sitea.mysite.com. These are all Sitecore generated links via LinkManager.

If I browse the site through sitea.mysite.com, I should only be seeing links that are using sitea.mysite.com as the domain. I'm not sure why the other domains are being output to the page for the links.

Both Sitea.mysite.com and nameofappservice.azurewebsites.net point to the same azure CD app service. sitea-staging.mysite.com points to the CD app service staging slot (for blue/green deployments).

Most of the time, I am seeing issues with nameofappservice.azurewebsites.net showing up in the links. The reason I even have this as a valid hostname for the site is to allow Azure Healthcheck to correctly ping the instances of the app service for uptime. This was a hostname gotcha that I found in this article - https://benrichardson.uk/2020/01/22/health-monitoring-of-azure-web-apps-with-sitecore/

  • 1
    Any of the components cached? With which vary by options?
    – Marek Musielak
    Aug 2, 2023 at 6:22
  • Try to use Targethostname on respective environments. Like for stage put sitea-staging.mysite.com in targethostname, same for other environment. Aug 2, 2023 at 9:02
  • @MarekMusielak yes some of the components are cached.
    – soze
    Aug 3, 2023 at 17:52
  • @GauravAgarwal I'll update the question with a little more context.
    – soze
    Aug 3, 2023 at 17:53

1 Answer 1


in SXA we need to update Valid for environment property in site settings (/Settings/Site Grouping/ SiteA), under Basic section.

enter image description here

The Valid for environment field defines where the site is resolved. Allowed values are empty string, *, or an environment name without blank spaces.

By default, SXA sites are assigned the *, which means that they can be resolved for every environment. If you have this wildcard assigned, the environment name that is defined in the Sitecore.XA.Foundation.Multisite.config file is overridden.


If the Valid for environment field value is different from the environment name specified in the Multisite config file, your site may not be resolved.

  • This is already set. In this scenario, both the sitea.mysite.com and the nameofappservice.azurewebsites.net are supposed to point to the same app service. One if for the public site, the other is for Azure to use as healthcheck since it pings the site using the azurewebsites.net host name.
    – soze
    Aug 3, 2023 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.