Generate sitemap by vanity url | Community
Skip to main content
Level 2
January 16, 2024
Solved

Generate sitemap by vanity url

  • January 16, 2024
  • 1 reply
  • 1246 views

Hello, currently I have tried two tools to generate the sitemap.xml:

1. https://experienceleague.adobe.com/docs/experience-manager-learn/sites/seo/sitemaps.html?lang=en

2. https://adobe-consulting-services.github.io/acs-aem-commons/features/sitemap/index.html

In both cases, it generates the sitemaps correctly, but due to the structure of the project, it doesn't work for creating a map of all the pages.

Is there a way to generate the sitemaps based on the vanity URL? Or any functionality that allows me to obtain a result similar to www.xml-sitemaps.com?

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 pulkitvashisth

Hi @juan_carlosra  ,
There are mainly 2 direct solutions I am aware of : 

 

  1. Sling Mapping: Sling mapping allows you to create a URL map between a /content URL in your repository and a shortened URL. This could potentially be used to map vanity URLs to their corresponding pages in the sitemap. Reference : https://helpx.adobe.com/experience-manager/kb/vanity-urls.html

  2. Customize Sitemap Servlet:
    You can checkout this very good blog by my colleague on "Exploring Apache Sling Sitemap Generator With Customization in AEM " .
    This blog covers step by step how to achieve the same by customizing the servlet that generates the sitemap. You could potentially include logic to pull in vanity URLs.

 

Some other ways are :

  • Dispatcher Vanity URLs: Creating a rewrite rule to handle vanity URLs in the Dispatcher could help in routing the requests properly. However, this wouldn’t directly affect the generation of the sitemap.
  • Third-Party Tools: Some third-party tools and libraries offer more flexibility and customization options when generating sitemaps. You could potentially use one of these tools to generate a sitemap based on vanity URLs.

1 reply

pulkitvashisth
Community Advisor
pulkitvashisthCommunity AdvisorAccepted solution
Community Advisor
January 16, 2024

Hi @juan_carlosra  ,
There are mainly 2 direct solutions I am aware of : 

 

  1. Sling Mapping: Sling mapping allows you to create a URL map between a /content URL in your repository and a shortened URL. This could potentially be used to map vanity URLs to their corresponding pages in the sitemap. Reference : https://helpx.adobe.com/experience-manager/kb/vanity-urls.html

  2. Customize Sitemap Servlet:
    You can checkout this very good blog by my colleague on "Exploring Apache Sling Sitemap Generator With Customization in AEM " .
    This blog covers step by step how to achieve the same by customizing the servlet that generates the sitemap. You could potentially include logic to pull in vanity URLs.

 

Some other ways are :

  • Dispatcher Vanity URLs: Creating a rewrite rule to handle vanity URLs in the Dispatcher could help in routing the requests properly. However, this wouldn’t directly affect the generation of the sitemap.
  • Third-Party Tools: Some third-party tools and libraries offer more flexibility and customization options when generating sitemaps. You could potentially use one of these tools to generate a sitemap based on vanity URLs.
Level 2
January 17, 2024

Hi @pulkitvashisth ,

 

Thanks, with point 2 I have managed to generate the sitemap with that requirement.