Sitemaps

Learn how to help boost your SEO by creating sitemaps for AEM Sites.

Resources

Configurations

org.apache.sling.sitemap.impl.SitemapScheduler~wknd.cfg.json

ui.config/src/main/jcr_content/apps/wknd/osgiconfig/config.publish

Defines the OSGi factory configuration for the frequency (using cron expressions) sitemaps will be re/generated and cached in AEM.

{
  "scheduler.name": "WKND Sitemaps",
  "scheduler.expression": "0 0 2 1/1 * ? *",
  "searchPath": "/content/wknd"
}

filters.any

dispatcher/src/conf.dispatcher.d/filters/filters.any

Allow HTTP requests for the sitemap index and sitemap files.

...

# Allow AEM WCM Core Components sitemaps
/0200 { /type "allow" /path "/content/*" /selectors '(sitemap-index|sitemap)' /extension "xml" }

rewrite.rules

dispatcher/src/conf.d/rewrites/rewrite.rules

Ensure .xml sitemap HTTP requests are routed to the correct underlying AEM page. If URL shortening is not used, or Sling Mappings are used to achieve URL shortening, then this configuration is not needed.

...
RewriteCond %{REQUEST_URI} (.html|.jpe?g|.png|.svg|.xml)$
RewriteRule ^/(.*)$ /content/${CONTENT_FOLDER_NAME}/$1 [PT,L]

On this page