Reputation: 3
Few days ago I set robots.txt for my website which you find in below:
user-agent: *
Allow: /$
Disallow: /
Now I am facing some problem to submit my sitemap in Google Webmaster:
We encountered an error while trying to access your Sitemap. Please ensure your Sitemap follows our guidelines and can be accessed at the location you provided and then resubmit.
I got this reply and also get:
URL restricted by robots.txt
Now what can I do to submit my sitemap in Webmaster?
Upvotes: 0
Views: 117
Reputation: 96737
Your robots.txt disallows accessing any URL except the root (/
, e.g.: http://example.com/
). So bots are (per your robots.txt) not allowed to crawl your sitemap.
You could add another Allow
line (like below), but in general there is probably no point in having a sitemap if you disallow crawling all pages except the homepage.
User-agent: *
Allow: /$
Allow: /sitemap.xml$
Disallow: /
(I removed the empty lines, because they are not allowed inside a record.)
Note that you could also link your sitemap from the robots.txt.
Upvotes: 1