Hello,
I checked your staging site and it seems that the sitemaps are working correctly, it’s just some of the required redirections that are not working.
If you visit the /sitemap-index.xml
URI on your staging site (or any of the sitemaps under it, such as /post-sitemap1.xml
), and view the source code, you can see that the XML sitemap itself is working, but the linked XSL file is not – /main-sitemap.xsl
returns a 404. We can only access that with the direct URI that looks like this: /?xsl=main
.
So the issues are basically that /sitemap.xml
should redirect to /sitemap-index.xml
and /?xsl=main
should be rewritten to /main-sitemap.xsl
(the rewrite pattern looks like this: '/([a-z]+)?-?sitemap\.xsl$/' => '?xsl=$1'
).
These issues are most probably related to your server configuration. Please get in touch with your hosting provider about these.
I’d like to add that the only purpose of the XSL file is to make the sitemap “human-readable” so in terms of SEO it doesn’t make a difference. Google will still see the sitemap correctly, even without the XSL. And, if you send in the correct /sitemap-index.xml
to Google in Search Console, then the /sitemap.xml
redirection isn’t important either.
In other words, these issues will not hurt your SEO.
Hope that helps.
-
This reply was modified 4 years, 3 months ago by
Balazs.
Still not understand.
sitemap-index.xml, post-sitemap1.xml, sitemap.xml, main-sitemap.xsl not work.
The only seems to work is /?xsl=main but show nothing.
Not sure why you ask me to redirect sitemap.xml to sitemap-index.xml if sitemap.xml return 404, what is the point redirect error 404?
Hello,
In my previous post, I was referring to your staging site. That’s where the sitemap-index.xml
is working, and the sitemap.xml
is showing a 404 error. In that case, you just need to add a server-level redirect from sitemap.xml
to sitemap-index.xml
– Rank Math does the same thing, on the WP-level. This redirect is added by Rank Math because usually the default URI where search engines and other bots look for the XML sitemap is sitemap.xml
. However, as I mentioned in my previous reply, if you tell Google (or other search engines) the correct URL (which is sitemap-index.xml
) then the redirect is NOT needed.
Since the 404 errors come directly from the server, and WordPress (along with PHP itself) is bypassed, Rank Math cannot do anything about these errors. You will need to configure your server so that those URLs can be handled by WordPress, only then will Rank Math be able to do its thing.
Hope that helps.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.