2

I have created a sitemap index and all the additional sitemaps that I want to upload into webmasters tools. Do I need to keep them in the root folder or can I just create a folder called "sitemaps" where I can store them all.

The reason I ask is because I see 99% of the websites keep them in the root folder and I do not know if it's a reason behind this. Perhaps other search engines can find it quicker this way?

Thank you.

ClawDuda
  • 1,197
  • 2
  • 12
  • 23
  • 2
    See this related question: http://webmasters.stackexchange.com/questions/30329/best-simplest-way-to-inform-search-engine-of-sitemap-location – dan Mar 15 '16 at 10:15

3 Answers3

2

No you do not need to keep them in the root folder, they do not need a file extension either. You should however have a redirect in place so that yourdomain.com/sitemap.xml points to wherever it's available at. This ensures that bots besides those you tell are able to find it via that common path. Here are a few examples I can think of that work for sitemaps:

  • A sitemap without file extension generated via index.php and available through a route/query such as "feed/sitemap" (Laravel, Codeigniter, Opencart, etc)
  • A sitemap generated via Cron and stored within public folder location that is buried ~6 levels deep (CS-Cart and others)
  • A sitemap that isn't even stored in the same server or same IP, think if you have 100k pages, a specialized app could sync, generate, and store all your sitemaps, feeds, etc to keep the load in the purpose built "app".
  • A sitemap that is chain loaded from another primary sitemap on another domain, such as loading blog, corp, KB, and other sitemap assets right in the primary domain sitemap.
dhaupin
  • 3,339
  • 13
  • 31
1

I can not comment but wanted to add my two cents:

You should however have a redirect in place so that yourdomain.com/sitemap.xml points to wherever it's available at

This may or may not be desirable. By providing a publicly accesible sitemap you're providing your competition an easy way to track your website content and progress.

This gives anyone a quick list of URLs your website has, making it unnecesarily to crawl it in order to monitor it.

I would suggest against using /sitemap.xml and, instead, use a name that is harder to guess, ie /my_website_sitemap.xml, and submit the sitemap to the most popular search engines, ie Google & Bing (the latter shares data with Yahoo Search).

Juanpi
  • 157
  • 1
  • 6
  • I hope you aren't the one who downvoted, because this is BS. You don't have to crawl to monitor it. Just site:domain.com in google to see all indexed pages, including the sitemap itself. – dhaupin Mar 17 '16 at 17:03
  • Uh, no I did not. This is by far a lot more complicated and involves crawling Google SERPS. By the way, my website's sitemap is not indexed. – Juanpi Mar 17 '16 at 17:30
1

There is a reason, URLs in an XML sitemap must be at the same, or lower level then where the sitemap is located.

e.g.

If you sitemap was located in the following folder:

http://www.example.com/sitemaps/sitemap.xml

Any URLs that were outside of /sitemap/ directory would not be valid, such as

http://www.example.com/example-page.html
http://www.example.com/example-directory/example-page.html

Only URLs within /sitemaps/ would be valid, such as

http://www.example.com/sitemaps/example-page.html
http://www.example.com/sitemaps//example-directory/example-page.html

This is outlined in Google's XML sitemap guildines as well as the offical xml sitemap protocols

Max
  • 6,127
  • 17
  • 40