This is part of the new Q&A section. Feel free to ask anything web related in the contact form.

Ran asks:

No matter which method I choose to submit my sitemap, I can’t get it to be accepted by Google Webmaster Tools. All I get is an X symbol for the sitemap status, and for each line in it, I get the following error:
“Paths don’t match
We’ve detected that you submitted your Site-map using a URL path that includes the www prefix (for instance, http://www.example.com/sitemap.xml). However, the URLs listed inside your Site-map don’t use the www prefix (for instance, http://example.com/myfile.htm).”

I too have come across this sitemap issue in the past. At first I tried to change my preferred domain (in Google Webmaster Tools, Site Configuration – > Settings) to http://mysite.com/ but then I got the message:
“Part of the process of setting a preferred domain is to verify that you own http://mysite.com/. Please verify http://mysite.com/.”

Therefore, in order to verify the other version of my site’s URL I did the following:

  1. I added a new site with the same URL but without the www prefix.
  2. I verified the site using the HTML file I already had in the root directory (if you have problems with the verification process, ask me in the comments section).
  3. Once I verified the site, I tried to change the preferred domain again, but for some reason it didn’t solve the sitemap error (not sure why, it might work for you though), so I went into Site Configuration ->Change of Address and selected the new domain I just verified (the non www prefix URL).

That was it. Problem solved.

Following this solution, there were two things left to do.
First, I deleted the redundant prefix URL version I no longer use (to prevent having both www and non-www versions in my GWT account).
Secondly, I made sure that all links with www prefix in my site will redirect to the non www prefix URL.
To do this, I defined a canonical 301 URL redirection as described in this post (not too complicated).

If you found a shorter solution to that sitemap error, let me know in the comments area.

Topics:   | |