Mobile app version of vmapp.org
Login or Join
Karen161

: Sitemap Error: some URLs redirect to other locations I have a site that is generating this warning: When we tested a sample of URLs from your Sitemap, we found that some URLs redirect

@Karen161

Posted in: #Google #LinkSubmission

I have a site that is generating this warning:


When we tested a sample of URLs from your Sitemap, we found that some URLs redirect to other locations. We recommend that your Sitemap contain URLs that point to the final destination (the redirect target) instead of redirecting to another URL".


Why is this a problem, and how do I correct it?

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Karen161

4 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

Its most likely that some URL's in your sitemap are redirecting to another page. You should find them out and stop the redirection. Remove all redirects, resubmit your sitemap and you will stop seeing the error.

10% popularity Vote Up Vote Down


 

@Harper822

You can use python code to iterate through all URLs and find their final destination, status code and rewrite sitemap contain only working valid links.

In this program, I have uses, python requests module with allow_redirect option.

10% popularity Vote Up Vote Down


 

@Si4351233

Some of the URLs listed in your sitemap are doing a redirect.

So if your sitemap has URL A , and when Googlebot goes there it redirects to URL B, you will get this error.

10% popularity Vote Up Vote Down


 

@Annie201

I'm taking a guess that the question is "How do I correct this error?".

What you need to do is review every sitemap file you have that applies to your running site and check every single URL. They are normally defined between these tags:

<loc> </loc>


Make sure no URL points to an automatic redirection page. These pages are short that return an HTTP status code of 301.

If possible, use a web browser that does not follow automatic redirects. Some older versions of Opera allow you to do this via settings. The advantage here is that if you connect to an automatic redirection page, then instead of the redirect, you'll see something like the following in on the screen:

Moved

The document is found here


and the word "here" is clickable to the actual page. Its that resulting URL that you need to have listed in the sitemap, not the url in the address bar when you saw that moved page.

Another option is to use CURL or some other command line tool that fetches webpages and displays the results as text. When you see the redirect page loaded this way, look for the line that contains:

<a


and within that a, :

href


then in the quotes after href should be the resulting URL that you should use in the sitemap.

Make sure every link in the sitemap points to an actual webpage, and not a redirect, then resubmit all sitemaps you edited to google then wait about two days for google to make a reaction.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme