Handling multiple-page XML Sitemaps #57

dnewkerk opened this Issue Jun 18, 2012 · 1 comment


None yet
2 participants

Hi Perusio, thanks so much for this great configuration! One thing I've run into is that XML Sitemaps that have to span multiple pages don't seem to work by default. I had to adjust a line in drupal.conf to get it working.

When the site has a large sitemap (the site in question has about 80,000 pages), in order to follow the sitemaps.org specification, XML Sitemap generates an index of sub-pages at example.com/sitemap.xml instead of the sitemap itself being on this page.

Then the actual sitemap is distributed to URLs such as:

Currently, the Nginx settings treat all of these as if they were only sitemap.xml, and the ?page= part is ignored and loads exactly the same page. Google Webmaster Tools presents an error message about the sitemap after switching to the Nginx configuration.

Here is my altered section in drupal.conf (the same adaptation is probably necessary in Drupal 6 related files):

## XML Sitemap support.
location = /sitemap.xml {
    ## For sitemaps with only one page.
    #try_files $uri @drupal-no-args;
    ## Large Sitemaps are split into multiple pages and use a pager
    ## query string, so uncomment this line instead.
    ## See http://www.sitemaps.org/faq.html#faq_sitemap_size
    try_files $uri @drupal;

This change gets the sitemap sub-pages to load correctly, though if you have any suggestions regarding performance, security, etc, please let me know (I'm an Nginx beginner at this point).



perusio commented Aug 29, 2012

That's correct. It's in fact what you have to do in order for the sitemap pager to work.I have to add it to the README. Hence leaving the issue open until so.

perusio was assigned Aug 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment