Debugging Sitemap 404 error

#35533
  • Resolved Brett Crosby
    Rank Math free

    Hi,
    Apologies if the is a duplicate post. I thought I logged a question yesterday but can’t see it in the system so I’ll try again.

    I’m having troubles with 404 errors on the sitemaps. The sitemap_index.xml is showing correctly however, whenever I try to view any of the page-sitemap.xml, post-sitemap.xml, etc, I’m getting a 404 error.

    So far I’ve tried:
    • Hitting save on the RankMath sitemaps page
    • Hitting save on the permalinks page
    • Purging all caches
    • Turning off all caches
    • Installing the Health Check and turning off all plugins.
    • Enabling only the Rank Math plugin in troubleshooting mode
    • Adding the suggested fix to the .htaccess file (which I have now removed)

    I’ve tried these things in various orders and multiple times and none of this has fixed the problem. Any other suggestions as to what could be causing the issue?
    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Todd
    Rank Math free

    Hi Brett,

    Thanks for getting in touch with us.

    Please ensure that you have at least one post/page/category/project and make sure at least one of them is indexable.

    You will get a 404 one the inner sitemap files if there is not a single indexable post/page/category/project inside them.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Just to clarify…
    Do I need one of each type (post/page/category/project) or just one of any type?
    As it stands, there is a homepage that is indexed and some other redundant pages that are not indexed.

    I started the topic what you are saw:
    https://support.rankmath.com/ticket/in-sitemap-page_sitemap-xml-404-error/

    Todd mentioned that this problem is happen if on your site only the home page is indexable and all other Non-homepage are noindex.
    So only one page is needed, no matter which post type, but I think this needs a fix from the developers.

    I added the index flag to one of the redundant pages and then the 404 error went away. However, when I viewed the page-sitemap.xml, it only showed the additional page and not the home page.
    Out of curiosity, I updated the canonical URL of the home page and added a trailing slash.
    The page-sitemap now generates and does not give the 404 error.
    The index page now appears in the sitemap.

    Questions:
    1. Will adding the trailing slash to the canonical URL cause any problems with SEO?
    2. Should I add the trailing slash to all permalinks?

    Thanks

    Todd
    Rank Math free

    Hi Brett,

    You only need one in each to make each one work correctly. I am glad that it is working fine for you.

    1. As long as the URL opens with a trailing slash too – there shouldn’t be any issue.

    2. You can but we recommend not to as that will create a 301 redirect for all non-trailing-slash URLs.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Thanks.
    I have enough to work around the issue now.

    Todd
    Rank Math free

    Hi Brett,

    I am so glad to be of help. We are always here if you need us in the future.

    Hey, if it isn’t too much to ask for – would you mind leaving us a review here?

    https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post

    It only takes a couple of minutes but helps us tremendously.

    It would mean so much to us.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Debugging Sitemap 404 error’ is closed to new replies.