Hi AEM Community
How can the .html extension be removed from the sitemap.xml generated ?
Is there a out of the box feature to support such ?
or this must be customizable ? any guidance to share?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @_Clodo_
As mentioned by others, this is not possible if you are using the AEM WCM Core Components Sitemap feature, in that scenario you will need to extend and customize to remove the extension, here is an example of that. Hope it helps https://www.theaemmaven.com/post/aem-apache-sling-sitemap
Hello @_Clodo_ ,
As you might know there are a few ways that Adobe provide and depending on which one are you using the answer might differ.
For example: ACS Commons offer a sitemap generator (now deprecated). Refer link [1] below.
Look for the property:
extensionless.urls
This property allows the AEM developer/administrator to choose if they would like to generate pages in the sitemap with or without extension via a simple configuration. This does not call for code customization.
Adobe recommended approach is [2]. Haven't seen a similar option for that though. May be its there in the latest version of that module. If its not, then that means customization.
So, again, it really depends on which solution is being used/planning to be pursued.
[1]: https://adobe-consulting-services.github.io/acs-aem-commons/features/sitemap/index.html
thanks,
Preetpal
Hi Preetpal
Yes my team is using the approach 2 ( https://experienceleague.adobe.com/docs/experience-manager-learn/sites/seo/sitemaps.html ), and seems we need to customize the piece to remove the file extension from the sitemap.xml
https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/overview/seo-and-ur... explains how to create custom Sitemap along with best practices for URLs.
Thank you Rawvarun
really appreciate that
hi @_Clodo_ are you using acs commons sitemap generater https://adobe-consulting-services.github.io/acs-aem-commons/features/sitemap/index.html or one offered by Adobe core ? - https://experienceleague.adobe.com/docs/experience-manager-learn/sites/seo/sitemaps.html
In Acs commons one I see below settings which could be useful to you :
Hi Pallavi
My team used the https://experienceleague.adobe.com/docs/experience-manager-learn/sites/seo/sitemaps.html
Hi @_Clodo_
As mentioned by others, this is not possible if you are using the AEM WCM Core Components Sitemap feature, in that scenario you will need to extend and customize to remove the extension, here is an example of that. Hope it helps https://www.theaemmaven.com/post/aem-apache-sling-sitemap
Thank you Esteban
Hello, could you give us a hint about where we should create the new class in the repository? @EstebanBustamante
@ffriaslopez Sorry I am not sure about your question, are you asking where you need to implement a new custom sitemap in your code base?
@EstebanBustamante Yes, that was my question.
Hello @_Clodo_ -
Unfortunately, there is no out-of-the-box (OOTB) solution in AEM to remove the ".html" extension from the URLs in the sitemap.xml.
However, here are two solution approaches that you may consider :
FIRST :
SECOND :
Hi Tanika
this it really helps
Hello @_Clodo_ I'm curious to know why does the business team want to strip the extension from the pages in the sitemap?
How do they plan to handle incoming page requests that could be sourced from the sitemap, lets say, when Google or other search bot picks from the sitemap? OR when the company's internal search engine looks at the sitemap to index pages?
How would the incoming requests without the extension be mapped to AEM pages with extension?
Pardon my ignorance if its just me wondering about this. And I wish there was a 1-to-1 chat option but there isn't one to my knowledge, I would've definitely avoided spamming
thx,
Preetpal
Hi Preetpal
The customer url pages are all rendered without .html pages today, its SPA react in AEM and all the links are like
www.customerdomain.com/home and www.customerdomain.com/products/creditcard
Reason why the requirement is without the .html on the sitemap.xml
My team found an example to extend the abstract class ResourceTreeSitemapGenerator from Sling so we need customize this part , lets see