Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

sitemap could not get fetched for non-www version

         

mhmghasemi

10:19 am on Mar 25, 2025 (gmt 0)



hi everyone

in GSC, i cant get my sitemap fetched correctly. the problem is google find the www-version of my website, which is redirected.
the sitemap address is: (sry, typed like this to get my topic approved --->) https ://example.ir/sitemap_index.xml which has 5 sitemaps inside it

i noticed when try to add this on domain property, it say "Success" but Discovered pages are zero and it's sub-sitemaps' status are also "Couldn't fetch".
i also cannot add this "https ://example.ir/post-sitemap.xml" to as a sitemap,
but when going with the "https ://www.example.ir/post-sitemap.xml" it finds the sitemap and also shows
the number of posts very fast! this also works for the other sub-sitemaps.

when i switch to the "https://" property, the problem continues as before. adding sitemap_index is successfull but it cant get fetched.

checked with my hosting support, screaming frog, and editted htaccess file and i'm sure the all the versions of website redirects and dont index on google.

note that i was using "xml sitemap generator for google" and saw it's about a month that google has not read my sitemap and has some errors too. (the sitemap address was example.ir/sitemap.xml) this problem continued and i started to use yoast sitemap generator now. gsc still can find the old sitemap when adding it to gsc.

any solution?


[edited by: not2easy at 11:57 am (utc) on Mar 25, 2025]
[edit reason] please use example.ir - see ToS [/edit]

not2easy

12:40 pm on Mar 25, 2025 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



You may need to take your question to the Apache forum: [webmasterworld.com...] because it sounds like your htaccess is not providing a smooth redirect. There is a right way to do it and it's easy to do it the wrong way.

Because you mention using Yoast for your sitemaps, I'm assuming this is a WordPress site. You can get excellent advice on Yoast's site about what to index and how to do it correctly: [yoast.com...]

It is easy to try to index "everything" but because WP shows the same content at multiple URLs you should avoid indexing everything or it is seen as duplicate content. Yoast explains the details.

If Google can still find the old sitemap, that means it still exists. You need to be sure that only the current sitemaps are available and that the actual sitemap index URL is in your robots.txt file.

I am concerned about this part:
i also cannot add this "https ://example.ir/post-sitemap.xml" to as a sitemap,
but when going with the "https ://www.example.ir/post-sitemap.xml" it finds the sitemap and also shows
the number of posts very fast! this also works for the other sub-sitemaps.
this indicates that you have not set up a proper canonical rewrite rule that agrees with your settings in the WP interface. If you have changed from using https://www. to using only https:// then you need to change your Settings within WP Admin interface and your .htaccess file - questions for the Apache forum.