Absolute URLs instead of relative URLs for XML Sitemap | Community
Skip to main content
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 Nitin_laad

Hi @robinbl1 

Have you reviewed the video on this page: Experience League that explains how to set up sitemaps at different paths? You can achieve this using AEM's out-of-the-box (OOTB) sitemap generator. Additionally, as outlined here: Sling Sitemap, you need to set sling:sitemapRoot = true for the /cards and /resources pages within the page properties.

Check the below ref for more info - Solved: How to create custom Sitemap url's on AEM 6.5 ? - Adobe Experience League Community - 667293

 

3 replies

arunpatidar
Community Advisor
Community Advisor
May 28, 2024

Hi @robinbl1 
Which utility are you using to generate sitemap? OOTB, sling sitemap or custom implementation?

 

Arun Patidar
Nitin_laad
Community Advisor
Nitin_laadCommunity AdvisorAccepted solution
Community Advisor
May 28, 2024

Hi @robinbl1 

Have you reviewed the video on this page: Experience League that explains how to set up sitemaps at different paths? You can achieve this using AEM's out-of-the-box (OOTB) sitemap generator. Additionally, as outlined here: Sling Sitemap, you need to set sling:sitemapRoot = true for the /cards and /resources pages within the page properties.

Check the below ref for more info - Solved: How to create custom Sitemap url's on AEM 6.5 ? - Adobe Experience League Community - 667293

 

BrettBirschbach
Adobe Champion
Adobe Champion
June 18, 2025

For those coming to this thread looking for an answer that works when you dont have Sling Mappings on your site, you can override the default SitemapLinkExternalizer with the following `@Component` code (I apologize the forum formatting is lowercasing some of the annotations) to ensure the sitemap URLs get externalized.

 

import com.adobe.aem.wcm.seo.sitemap.externalizer.SitemapLinkExternalizer; import com.day.cq.commons.Externalizer; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.settings.SlingSettingsService; import org.jetbrains.annotations.NotNull; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.ConfigurationPolicy; import org.osgi.service.component.annotations.Reference; /** * An implementation of {@link SitemapLinkExternalizer} that overrides the default implementation to * use the Sling Externalizer to generate fully qualified URLs for the sitemap. * <p> * Enable this component to generate fully qualified URLs in the sitemap when there are no sling mappings. */ @Component( property = {"service.ranking:Integer=" + Integer.MAX_VALUE}, configurationPolicy = ConfigurationPolicy.REQUIRE, service = {SitemapLinkExternalizer.class, org.apache.sling.sitemap.spi.common.SitemapLinkExternalizer.class} ) public class SitemapLinkExternalizerImpl implements SitemapLinkExternalizer { @3214626 private Externalizer externalizer; @3214626 private SlingSettingsService slingSettingsService; @9944223 public @126844 String externalize(SlingHttpServletRequest request, String path) { return externalize(request.getResourceResolver(), path); } @9944223 public @126844 String externalize(Resource resource) { return externalize(resource.getResourceResolver(), resource.getPath()); } @9944223 public @126844 String externalize(ResourceResolver resourceResolver, String path) { String mode = slingSettingsService.getRunModes().contains("author") ? "author" : "publish"; return this.externalizer.externalLink(resourceResolver, mode, path); } }