Hello,
Thanks for reaching out.
Can you please ensure that the Yoast XML Sitemap feature is ‘Enabled’ in your WordPress dashboard > SEO > General > Features?
The sitemap was already enabled! I removed the Yoast plugin and installed it again but still, I am getting the same issue. It is just a one-page site but still, this is happening.
We are sorry to hear that you’re still having trouble with the sitemap index. Sometimes resetting the permalink structure will quickly solve a 404 error from a recent change to your installation. Go to Admin > Settings > Permalinks and click save without altering anything. (How to Guide available here.)
If the issue remains, please try the suggestions here: My sitemap is giving a 404 error, what should I do?
I did what you advised but it is not working. The sitemap continues to point to the homepage.
There is an issue related to “forcing trailing slash”:
$ curl -k -i https://furlytics.com/sitemap_index.xml
HTTP/1.1 301 Moved Permanently
Date: Thu, 15 Jul 2021 06:22:29 GMT
Server: Apache
...
X-Redirect-By: WordPress
...
Location: https://furlytics.com/sitemap_index.xml/
...
When I try to access via query string (/?sitemap=1
) then the sitemap index works (same for sub sitemaps).
I deleted my site (it was just a one-page site) and created a new site with a fresh WordPress installation but still I am getting the same issue. I am clueless what I should do now.
Hi @mjaitly123
The Yoast SEO XML sitemap URL uses a pretty permalink of example.com/sitemap_index.xml
but, behind the scenes, this URL also has a non-pretty permalink of example.com/?sitemap=1
. If you can load and see the sitemap using the non-pretty permalink, your server is not set up to redirect and, thus, you’ll need to add redirect rules.
Upon checking, the Yoast SEO sitemap loads using the non-pretty permalink https://furlytics.com/?sitemap=1.
However, when trying to access the pretty permalink https://furlytics.com/sitemap_index.xml, it seems to be an issue related to “forcing the trailing slash” (as it attempts to 301 redirect to https://furlytics.com/sitemap_index.xml/ with the trailing slash instead of just loading the version without the trailing slash).
You may need to check with your web host for the settings that are enforcing this trailing slash. You can also learn more about setting up Yoast XML Sitemaps on Apache servers here – https://yoast.com/help/xml-sitemaps-apache/
-
This reply was modified 2 years, 9 months ago by Michael Tiña.
I changed the permalink settings to post name only and then the issue got resolved. Thanks.