Hitendra
Hitendra

Reputation: 3

Google Webmaster Tools is not accepting my sitemap

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

Answers (1)

unor
unor

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

Related Questions