If robots.txt points to a sitemap in a sub-folder, can the sitemap specify URLs in the root?
Suppose I have a robots.txt file in my root, http://domain.com/robots.txt, that specifies a sitemap in a sub-folder that has a single declaration that points to a sitemap index:
Suppose also that the sitemap index points to a sitemap.xml that same the sub-directory:
<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap> <loc>http://domain.com/sub/sitemap-1.xml</loc> </sitemap> </sitemapindex>
In the sitemap specification, it clearly states that the sitemap can only specifies URLs in the current folder or sub-folders. However, does this change in the scenario I described above? The reason I ask is that I know that a robots.txt file can point to sitemap hosted on a completely different domain. If this is possible, then it stands to reason that a sitemap in a subfolder, but pointed to from robots.txt in the root, can specify URLs in the root and all sub-folders from there.
Anyone know for certain?
yes it will change in the scenario you mentioned above. In the above scenario your Robot.txt can point to the same domain url's from any directory either sub or main.