Hello,
We apologize for the issue you are facing with your sitemap. It seems like there are a couple of potential reasons for the 404 error and the incorrect sitemap generation in your subsite.
Here are some steps you can take to troubleshoot and fix the sitemap issues:
-
Flush Permalinks: Sometimes, simply flushing the permalinks can resolve 404 errors. Go to your WordPress dashboard, navigate to Settings → Permalinks, and click Save Changes without making any changes. This action refreshes the permalink structure.
-
Check Sitemap Configuration: Ensure that the sitemap module is enabled for your subsite. You can do this by going to Rank Math SEO → Sitemap Settings and confirming that all necessary options are checked.
-
Check for Plugin Conflicts: There might be a conflict with another plugin. You can use the Health Check plugin to identify any conflicts that may be affecting your sitemap.
-
Review Robots.txt: Make sure that your robots.txt
file is not blocking access to your sitemap. You can check this by going to Rank Math SEO → General Settings → robots.txt.
-
Nginx or Apache Rewrite Rules: If you are using Nginx or Apache, ensure that the appropriate rewrite rules are set up in your server configuration. For example, if you are using Apache, you may need to add the following to your .htaccess
file:
# START of Rank Math Sitemap Rewrite Rules
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
# END of Rank Math Sitemap Rewrite Rules
-
Validate Your Sitemap: Use a tool like the Validate XML Sitemap to check if your sitemap is correctly configured.
If these steps do not resolve the issue, we recommend replying to this ticket with your site URL so that a human agent from our support team can assist you further. Thank you for raising this concern!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
How to Configure Sitemaps in Rank Math – Best Settings and Tips
Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math
This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.
Hello,
Thank you for your query and we are so sorry about the trouble this must have caused.
Can you please follow these steps?
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/
That should fix the issue.
Please let us know if that does not. We are here to assist.