Expand my Community achievements bar.

SOLVED

AEM apache sling sitemap generator is generating sitemap for author but not generating sitemap index.

Avatar

Level 1

I am able to successfully generate sitemap for config.author.

 

KomalJo_0-1709156501191.png

 

I have following configuration in config.author.local

KomalJo_1-1709156587232.png

 

However, sitemap-index is not getting generated.

 

I also have following content in filter.any

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

 

Rewrite rules

# allow sitemap access
RewriteCond %{REQUEST_URI} ((sitemap-index|sitemap).xml)$
RewriteRule ^(.+)\/?$ ${lc:$1} [PT,L]

 

Could someone please help on how to generate sitemap-index. I thought it is automatically taken care of

1 Accepted Solution

Avatar

Correct answer by
Level 4
7 Replies

Avatar

Community Advisor

do you have multiple sitemaps ?

 

 The sitemap index is a way to link to multiple sitemaps. If you only have one sitemap, the sitemap index might not be generated because it's not needed.

can you check error logs and see for any errors, if the above statement is not correct.

Avatar

Level 1

Yes I have multiple sitemaps. It does not look like there are any errors

Avatar

Community Advisor

@PBJelly I agree with @SureshDhulipudi If you site is small, it’s fine to have a single Sitemap for them. However, if sites grow large, you can leverage AEM’s Sitemap index file capabilities. And to do this, all we have to do is request that top level Sitemap page with sitemap-index.xml, instead of these .sitemap.xmlselectorandextension. And this will return a standards compliant Sitemap index file that in turn lists all the Sitemap files that represent the site. 

 

It is recommended that you create a sitemap-index.xml file that references all your sitemaps and keep that as part of your project code in your github repo. This way it is easy to add new sitemaps as the project expands.

Follow below link to implement sitemap index:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/edge-delivery/publi...

Avatar

Level 1

We have multiple sitemaps. For every page, we have a sitemap. The structure looks like

 

content

   --domain

       --location1

            --locale1

                 --sitemap.xml

            --locale2

                 --sitemap.xml

       --location2

            --locale1

                 --sitemap.xml

            --locale2

                 --sitemap.xml

 

So there needs to be a sitemap-index at location1, location2 and domain. From what you mentioned, I simply need to request for top level with sitemap-index.xml without any additional configuration, right? I did that but it did not work

 

The thing is, I am generating sitemap in author. Can I visualize sitemap-index in crxde? I can see sitemap.xml in my crxde but not sitemap-index

Avatar

Administrator

@PBJelly Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Level 4

Hi @PBJelly,

 

When you want to have multiple sitemaps inside the sitemap-index.html, you need to the enable the "Generate Sitemap" page property for all the required roots. So in your case, I think you need it enabled for all locations and locales. Can you pls check if this helps?

rk_pandian_0-1709827576355.png

 

Regards,

Ramkumar

Avatar

Correct answer by
Level 4