How to disable auto redirects?

#738382
  • Resolved Tiago AndrĂ©
    Rank Math free

    Hello,

    I’m in the process of changing the sitemap slug, but I’m facing some issues.

    After change the sitemap names, the old name (sitemap_index), auto redirects to the new name, and we want to avoid users to find out the sitemaps.

    How can I prevent this?

    Accordingly to httpstatus.io is the Rank Math creating the redirect.

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

    I’m sorry to hear about the issue you’re facing with the auto redirects after changing the sitemap slug. To disable the auto redirects in Rank Math, you can follow these steps:

    1. Go to your WordPress Dashboard.
    2. Navigate to Rank Math SEO → General Settings → Redirections.
    3. Find the Auto Post Redirect option and disable it.

    By turning off the Auto Post Redirect feature in Rank Math, you can prevent the automatic redirection of old URLs to new ones. This should help you avoid users finding the sitemaps easily.

    If you encounter any difficulties or need further assistance, please feel free to reach out.

    Sources:
    Solving Redirection Issues Using Rank Math SEO Plugin » Rank Math
    How To Exclude Rank Math Sitemaps from Caching » Rank Math
    How to Redirect Posts After Changing URLs » Rank Math
    Rank Math Sitemap Issues and Their Fixes » Rank Math
    Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math

    That’s already unchecked.

    Hello,

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

    Could you please confirm which method you’ve used to change the sitemap slug? We used the filter to change the sitemap slug but it is not redirecting.

    In this case, please try to clear your sitemap cache by following this screencast: https://i.rankmath.com/pipRDp

    After that, please head over to your WordPress Dashboard > Settings > Permalinks, and hit the “Save Changes” button (without making any changes) to clear the permalink cache.

    Once done, please clear your website cache and see if that works for you.

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

    Thank you.

    Hey!

    Thanks for the help, but I already did everything, and the rank math stills redirects ‘sitemap.xml’ for the new slug.

    My code:

    add_filter( 'rank_math/sitemap/index/slug', function($slug) {
    
        $modified_slug = 'qweindexl';
    
        return $modified_slug;
    });

    I don’t have any redirect created by me.

    Hello,

    I just used this exact code you shared to modify the sitemap slug and the old slug didn’t redirect to the new slug. In this case, we’d need to investigate the issue on your end.

    To help you investigate this issue, we might need to take a closer look at your website and settings. Please follow these steps:

    • Edit the first post on this ticket and include your WordPress logins in the Sensitive Data section. This is a secure section that only our support staff can access.
      Sensitive Data Section
    • Make sure you take a complete backup of your website before sharing the information with us.
    • If you prefer, you can use this plugin to generate a temporary login URL to your website and share that with us instead: https://wordpress.org/plugins/temporary-login-without-password/
    • You can also use this plugin to monitor what changes our staff might make on your website (if any): https://wordpress.org/plugins/wp-security-audit-log/

    We appreciate your cooperation and patience. Thank you for choosing Rank Math.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    Thank you for your patience.

    We’ve tried logging in to your site, but it seems that the user is not yet registered on your site as we get this error: Error: The username is not registered on this site.

    Could you please check?

    Looking forward to hleping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    The default behavior of our plugin is to redirect the sitemap.xml to its sitemap URL. Since you don’t want to do that, I have added a redirection rule in the Redirections module of our plugin to redirect the sitemap.xml to the homepage.

    The sitemap_index.xml is already returning a 404 error:

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

    Well, that’s a smart move.

    Thanks!

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘How to disable auto redirects?’ is closed to new replies.