If you take a look at the current implementation of the SitemapGenerator
service in Sitecore.XA.Feature.SiteMetadata.dll
, there is a method GetFullUrl which renders the url in the sitemap
protected virtual string GetFullLink(Item item, SitemapLinkOptions options)
{
string itemUrl = LinkManager.GetItemUrl(item, options.UrlOptions);
return options.Scheme + Uri.SchemeDelimiter + options.TargetHostname + itemUrl;
}
You can implement your own sitemap generator which will inherit from SXA SitemapGenerator
service and override just the GetFullUrl
method.
You should also verify if this isn't an issue in your current SXA version because in the latest version of SXA the method is implemented like this:
protected virtual string GetFullLink(Item item, SitemapLinkOptions options)
{
string uriString = LinkManager.GetItemUrl(item, options.UrlOptions);
if (!uriString.StartsWith("/", StringComparison.Ordinal))
uriString = new Uri(uriString).LocalPath;
return options.Scheme + Uri.SchemeDelimiter + options.TargetHostname + uriString;
}