Error 404 en sitemap

#1115807
  • My WordPress site lachicota.com show 404 in sitemamp every days, I reload with save changes in permalinks but at the next day fail again. I dont have cache plugin

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

    We apologize for the issue you are facing with the 404 error in your sitemap. Since you’ve already tried flushing the permalinks and the problem persists, here are a few additional steps you can take to troubleshoot this issue:

    1. Check for Rewrite Rules: If you are using an Nginx server, ensure that the necessary rewrite rules are added. You can add the following rules to your server configuration:

      # 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
    2. For Apache Servers: If you are on an Apache server, you may need to add the following rules 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
    3. Exclude Sitemap from Caching: Even though you mentioned not having a caching plugin, ensure that there are no server-level caching mechanisms that might be affecting your sitemap. You can also check if your hosting provider has any caching settings that need to be adjusted.

    4. Check Robots Meta Tags: Ensure that your pages are set to index in the robots meta tag. Pages set to noindex will not appear in the sitemap and could lead to errors.

    5. Contact Hosting Support: If the issue continues, it might be beneficial to reach out to your hosting provider for assistance, as they can help identify any server-related issues that may be causing this problem.

    If you continue to experience difficulties, please reply 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:
    Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
    Rank Math Sitemap Issues and Their Fixes » 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 contacting us. We apologize for any inconvenience this issue may have caused.

    Please follow the steps below for initial troubleshooting:

    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/

    If the issue persists then try disabling the transient cache for the sitemap. This will make sure that your XML sitemap always reflects the latest changes on your site. Kindly add this code snippet to your site:

    
    /** 
     * Filter if XML sitemap transient cache is enabled.
     *
     * @param boolean $unsigned Enable cache or not, defaults to true
     */
    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');

    If you’re not sure how to add this code, you can follow this guide: https://rankmath.com/kb/wordpress-hooks-actions-filters/.

    After you add the code, please clear any cache on your site or server and check your XML sitemap again. If you’re still facing issues with the sitemap, please let us know – we are happy to investigate further.

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

You must be logged in to reply to this ticket.