Expand my Community achievements bar.

SOLVED

Generate sitemap by vanity url

Avatar

Level 2

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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.

Avatar

Level 2

Hi @pulkitvashisth ,

 

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