I am creating multiple sitemaps for a site, and for the sake of organization I would like to put these sitemaps into their own directory (of course the sitemap.xml file will be in the root site directory). Is this possible? I've looked through the protocol and it doesn't address this issue.


I did not clearly state my issue, which is this. If I have a sitemap index, can the sitemaps listed in the index be located in a subdirectory, such as http://www.example.com/sub1/sub2/sitemap2.xml? Sitemap2.xml does not include paths that is only for /sub2/. Sitemap2.xml might contains links such as http://www.example.com/FooBar.

1 Answer 1


Yes. It used to be required to have your XML sitemaps in your root directory but it has since been changed to allow you to place your sitemaps within subdirectories of your choosing.

From http://www.sitemaps.org/faq.html#faq_sitemap_location

Q: Where do I place my Sitemap?

It is strongly recommended that you place your Sitemap at the root directory of your HTML server; that is, place it at http://example.com/sitemap.xml. In some situations, you may want to produce different Sitemaps for different paths on your site — e.g., if security permissions in your organization compartmentalize write access to different directories. We assume that if you have the permission to upload http://example.com/path/sitemap.xml, you also have permission to report metadata under http://example.com/path/. All URLs listed in the Sitemap must reside on the same host as the Sitemap. For instance, if the Sitemap is located at http://www.example.com/sitemap.xml, it can't include URLs from http://subdomain.example.com. If the Sitemap is located at http://www.example.com/myfolder/sitemap.xml, it can't include URLs from http://www.example.com.

  • I wonder if multiple subdirectors are also OK, such as example.com/sub1/sub2/sub3/sitemap1.xml
    – RHPT
    Dec 22, 2011 at 17:59
  • Was it really ever required to have sitemaps in the root? I had mine in subdirectories years ago, right when XML sitemaps first came about. Dec 22, 2011 at 22:15
  • And yes @RHPT the sitemap location can be wherever you wish at all. Dec 22, 2011 at 22:16
  • If the Sitemap is located at example.com/myfolder/sitemap.xml, it can't include URLs from example.com. Note that the sitemap is for the items in the folder and folders below its location. In root, whole site. In Subdir, that subdir and below. Dec 23, 2011 at 2:28
  • @FiascoLabs I meant "if the included sitemap in the sitemap index (located at the root) can be placed in a subdirectory". So example.com/sitemap.xml includes a sitemap at example.com/sub/sub/sitemap2.xml.
    – RHPT
    Dec 23, 2011 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.