Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.


UPDATE

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.

share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
I wonder if multiple subdirectors are also OK, such as example.com/sub1/sub2/sub3/sitemap1.xml –  RHPT Dec 22 '11 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. –  DisgruntledGoat Dec 22 '11 at 22:15
    
And yes @RHPT the sitemap location can be wherever you wish at all. –  DisgruntledGoat Dec 22 '11 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. –  Fiasco Labs Dec 23 '11 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 '11 at 16:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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