This error is little confusing for me. For populating sitemap we are using SXA. Same settings are working on CM server but not on CD server. Sitemap.xml show urls but hostname is missing from there. Here is snapshot.

enter image description here

Url => loc should have host name, but it does not show. It should be something like https://example.com/searchresults but it misses the hostname.

Both CD and CM are on Azure PaaS App service.

  • Do you have targetHostName set for your site? Jun 6 '19 at 8:09
  • Target hostname is blank
    – OyeHarish
    Jun 6 '19 at 8:41

From what I can see, sitemap.xml host is generated in the following order:

  1. If targetHostName site property is not empty, it's used.
  2. If hostName property doesn't contain wildcards (*) or multiple hostnames (joined with |), it's used.
  3. Otherwise request host name is used.

The only scenario which would generate blank host name is when both targetHostName and hostName are empty. Is that the case?

You should really set targetHostName to make sure all your urls for the site are generated with unique host name on your CD server.

  • targetHostName is set to blank, hostname is set to wildcard charachter (*). May be targetHomeName is getting used that why it does not show hostname. But same setting are configured on CM. There it work well.
    – OyeHarish
    Jun 6 '19 at 8:57
  • Which SXA version you use? Jun 6 '19 at 9:05
  • SXA is at 1.5 version
    – OyeHarish
    Jun 6 '19 at 9:13
  • I assume you use SXA site definition defined on items in Sitecore tree. Can you switch to web database and see if your site definition is there and if hostName is set to * there or it's empty? I don't see any other way how you can get empty hostname in your sitemap. Jun 6 '19 at 9:47
  • Thanks @Marek Musielak, I will just veriy it.
    – OyeHarish
    Jun 6 '19 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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