Sitemap and Homepage Redirect Issues

#902858
  • Resolved Valerie Burns
    Rank Math free

    We’re encountering two issues since pushing our staging site live (we clone the full environment, including the database). I will attach relevant screenshots to illustrate each problem.

    Issue 1: Sitemap Errors and Unexpected Redirect
    Our weekly AHREF report flagged several sitemap errors and warnings, including:

    “Sitemap in the wrong format”
    “Redirect target changed”
    “Indexable page became non-indexable”
    When attempting to access our sitemap at https://arch-design.com/sitemap_index.xml, it now redirects to the home page instead of displaying the sitemap. In a support chat with our hosting company (WPEngine) we were told that the redirect was coming from RankMath, but it is not in our settings.

    Issue 2: Homepage Redirect Loop
    AHREF also reported three redirects from our home page to itself. Two of these were due to HTTP to HTTPS redirects, which are expected, but one remains unexplained: a two-step redirect from http://arch-design.com to http://arch-design.com to https://arch-design.com. I will attach a screenshot showing a redirect chain.

    Notes: We use RankMath for managing redirects. No redirects from or to our home page are configured, except for the Fallback Behavior which is set to redirect to the home page. We do not have any redirects to or from the sitemap in RankMath.

    Could you please investigate these issues to identify the cause of the sitemap error and the homepage redirect? Thank you for your help in resolving this.

    You can see the relevant part of the AHREF report in screenshots here and a subsequent report here.

    Here is a link to the detail on the 2-step redirect from/to the home page.

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

    We apologize for the issues you are facing with your sitemap and homepage redirects. Thank you for providing detailed information about the problems.

    Issue 1: Sitemap Errors and Unexpected Redirect

    The errors you are encountering with your sitemap, such as "Sitemap in the wrong format" and unexpected redirects to the homepage, can often be caused by a few factors:

    1. Check for Plugin Conflicts: Since you mentioned that the redirect is coming from Rank Math, it’s essential to check for any plugin conflicts. You can use the Health Check plugin to identify if another plugin is causing this issue.

    2. Rewrite Rules: Ensure that your server’s rewrite rules are correctly set up. If you are using an Nginx server, you may need to add the following rewrite rules to your Nginx config file:

      # 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

      If you are on an Apache server, ensure your .htaccess file has the correct rules as well.

    3. Caching Issues: Sometimes, caching plugins can interfere with sitemap generation. Make sure to flush your cache and exclude the sitemap from caching if necessary.

    4. Custom Canonicals: If you have custom canonical URLs set for your posts, they may not appear in the sitemap. Ensure that all posts have the correct canonical settings.

    Issue 2: Homepage Redirect Loop

    For the homepage redirect loop, it seems like there might be a misconfiguration in your redirect settings:

    1. Check Redirects in Rank Math: Double-check your redirect settings in Rank Math to ensure there are no unintended redirects configured. Since you mentioned that no redirects are set for the homepage, it might be worth reviewing the Fallback Behavior settings.

    2. HTTP to HTTPS Redirects: Ensure that your SSL settings are correctly configured. Sometimes, having both server-level and plugin-level redirects can cause loops. You may want to check if your hosting provider has any additional settings that could be affecting this.

    3. Redirect Chains: The two-step redirect from HTTP to HTTPS could be due to multiple layers of redirection. It’s advisable to simplify these redirects to avoid confusion and potential loops.

    If these suggestions do not resolve the issues, please reply to this ticket with any additional details or screenshots, and a human agent from our support team will assist you further.

    Thank you for your patience as we work through these issues together!

    In response to your bot’s suggestions:

    1.1 – I used the tool you recommended and see no conflicts.
    1.2 – This can’t be the problem as RM has been installed on our site for years and we did not have any problems until today. I also chatted with WPEngine tech support before coming here.
    1.3 – All of our caches are emptied after we push our staging site live. I have also emptied all of them again to make sure.
    1.4 – We have no custom canonicals.

    2.1 – I have checked for redirects in our list in RM and there are no redirects to/from the home page or sitemap.
    2.2 – We only have one redirect at the server level (that I know of): http://arch-design.com to https://arch-design.com.
    2.3 – There are no redirects in RM for our sitemap or the home page. And I have confirmed with WPE that there are no redirect chains at the server level.

    I have found additional redirects FROM the same page as the TO. I have confirmed that none of these are intentional redirects as they do not appear in our RankMath list of redirections.

    Additional redirects found on AHREFs

    Hello,

    Please note that Rank Math doesn’t handle the server/domain-level redirections on your website. You’re seeing multiple redirections on your homepage because you’re checking the WWW and HTTP version of your website.

    First, it is getting redirected to the Non-WWW and then it is getting redirected to HTTPS and all of these redirections are getting handled by your server:

    Regarding the sitemap issue, 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. Apply the following filter to your site to disable the transients cache for sitemap.

    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/

    For the other redirections, they are getting redirected from the non-trailing slash to the trailing slash version by WordPress:

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Thank you for that information. I will step through it.

    But what is happening and why did it happen? I want to know if there is something in the cloning process of my environments that is causing a problem.

    Hello,

    Just as we stated those WWW and HTTP redirects are done on the server level most likely implemented by your host provider. Those redirects are actually correct since the URL structure of your site is without the WWW and with the HTTPS protocol.

    Similarly, the trailing slash redirect is added to ensure there’s only one version of your site. This prevents your site’s SEO from being watered down due to duplicate content issues.

    We hope this helps.

    Thanks.

    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 6 replies - 1 through 6 (of 6 total)

The ticket ‘Sitemap and Homepage Redirect Issues’ is closed to new replies.