Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
Please note that the sitemap generates on the fly in Rank Math, when you enable that module. We rely on redirects enabled by your server software to accomplish that. As the Sitemap doesn’t work in your case, you may have to add some rewrite rules to them in order to function sitemaps properly.
If you visit the /sitmeap_index.xml
URI on your site and view the source code of your sitemap, you will be able to see that the XML sitemap itself is working and that’s why it is validating fine. But the linked XSL file /main-sitemap.xsl
returns a 404 error. We can only access that with the direct URI that looks like this: /?xsl=main
.
So the issue is basically that /?xsl=main
should be rewritten to /main-sitemap.xsl
(the rewrite pattern looks like this: /([a-z]+)?-?sitemap\.xsl$/' => '?xsl=$1
).
This issue is related to your server configuration. We suggest you get in touch with your hosting provider for this issue.
Once done, please try to follow the steps below to clear your sitemap cache and see if that works for you.
1. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp
2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
https://rankmath.com/kb/exclude-sitemaps-from-caching/
3. If the above steps don’t seem to work, kindly apply the following filter to your site.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here’s how you can add filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how it goes. Looking forward to helping you.
Thank you.