0

I am using sitecore 10.3 with jss next app, using SXA with jss, I have an issue with OTB sitemap.xml as the English urls not come in sitemap like this

https://new-murabba.mirummea.com/ 2024-07-04 always https://new-murabba.mirummea.com/ar 2024-07-04 always

I need to display also the English url, here is my configuration for sitemap enter image description here

and here is the configuration of our customproviderLink

<add name="MurabbaLinkProvider" type="Sitecore.XA.Foundation.Multisite.LinkManagers.LocalizableLinkProvider, Sitecore.XA.Foundation.Multisite" cacheExpiration="5" addAspxExtension="false" alwaysIncludeServerUrl="false" encodeNames="true" languageEmbedding="always" languageLocation="filePath" shortenUrls="true" useDisplayName="false" patch:source="Murabba.Project.Website.config"/>

any idea what is missing or what shall I check to know the issue rootcause??

1 Answer 1

0

Sitemap urls inside SXA JSS (Headless) project is generated from the CreateUrls processor inside the sitemap.createSitemap pipeline as show below.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
      <pipelines>
        <sitemap.createSitemap>
             <processor type="Sitecore.XA.Foundation.SiteMetadata.Pipelines.Sitemap.CreateSitemap.CreateUrls, Sitecore.XA.Foundation.SiteMetadata" resolve="true" />
        </sitemap.createSitemap>
      </pipelines>
    </sitecore>
</configuration>

Inside the pipeline processor, there is a check when the Site Context language is equal to the item language, language embedding is set to never. Therefore since by default Site Context language is "en", therefore for English language we don't get the language embedded inside the sitemap url.

enter image description here

Note: The default language for each site can be set inside Site Node in the Site Grouping folder.

enter image description here

You can modify the pipeline processor enlisted above to set the Language Embedding as always.

Hope this helps you to know the root cause for this behaviour!!!

3
  • I changed the default site language to be "ar" instead of "en" and I published the pages so as the above code the urls inside sitemap.xml should now include en languge code but it still the same. Commented 2 days ago
  • @shimaaelsayed Did you checked the sitemap file locted in your media library for your site. It should contain the updated changes..The sitemap.xml is generated from the sitemap file in your media library...
    – ckhanna
    Commented 2 days ago
  • And also publish this media library sitemap file...Check the last updated date as well for this..Let me know in case you have any doubts..
    – ckhanna
    Commented 2 days ago

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.