Sitemap pages 404-ing

#872483
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    We apologize for the issue you are facing with your sitemap pages returning 404 errors. It can be frustrating when things don’t work as expected.

    To resolve the 404 error for your sitemap, we recommend trying the following steps:

    1. Flush Permalinks: Go to your WordPress admin area, navigate to Settings → Permalinks, and hit the “Save Changes” button. This action can often resolve issues related to permalinks and sitemap generation.
      Flush permalink settings

    2. Check Rewrite Rules: If flushing permalinks does not work, you may need to check your server’s rewrite rules. For Apache servers, ensure that your .htaccess file contains the necessary rewrite rules for Rank Math sitemaps. Here’s an example of what you might need to add:

      # 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
    3. Nginx Configuration: If you are using Nginx, ensure that your Nginx configuration file has the correct rewrite rules as well:

      # START Nginx Rewrites for Rank Math Sitemaps
      rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
      rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
      rewrite ^/([a-z]+)?-sitemap.xsl$ /index.php?xsl=$1 last;
      # END Nginx Rewrites for Rank Math Sitemaps
    4. Check for Plugin Conflicts: Sometimes, other plugins can interfere with the sitemap functionality. You can use the Health Check plugin to identify any potential conflicts.

    If you have tried these steps and are still experiencing issues, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.

    Thank you for raising this concern, and we hope to get this resolved for you soon!

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    Can you please try to follow the steps below 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.

    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.

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

The ticket ‘Sitemap pages 404-ing’ is closed to new replies.