Sitemap redirecting to home page outside of WP Admin

#808651
  • Resolved TheHDRoom
    Rank Math free

    Hello, every since moving my website from Kinsta to Hostinger I have been unable to access this sitemap outside of the WP Admin area, which means Google or anyone else cannot either.

    https://thehdroom.com/sitemap_index.xml

    I can access it from the Rank Math Sitemap settings page where it’s linked, but that is the only place.

    Multiple people at Hosting keep informing me that it’s a plugin issue, but I did not have this issue with Yoast and Kinsta previously. It began when I moved to Hostinger, and is the same whether Yoast or Rank Math is activated. They have told me to create a sitemap another way.

    In an attempt to fix this, I have already tried adding this recommended code from Rank Math to .htaccess to no avail:

    # 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

    I am at my wits end. Any ideas? My complete htaccess is in Sensitive Data, and I am happy to grant access to my WP Admin area so you can look at any Rank Math settings, including redirects, that are there.

    Thanks, Dan

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

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

    We tried to check your sitemap but it is showing a 403 error:

    Your homepage is also showing the same error as the sitemap. Since you’re able to access your sitemap when you’re logged in that means Rank Math is generating the sitemap properly for your website.

    In case, you’re using any GEO blocking, please try to whitelist or open access to countries India, Bangladesh, Portugal, Nigeria, and the Philippines so that we can investigate this issue further for you.

    Or you can share any whitelisted country name so that we can set this on VPN.

    Looking forward to helping you.

    Thank you.

    Thank you, Rakibuzzaman.

    I have confirmed or removed those five countries from geo blocking.

    Thank you!

    Hello,

    For troubleshooting, please follow these steps to flush your sitemap cache:

    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. Disable the transient cache for the sitemap by applying this filter. This will make sure that your XML sitemap always reflects the latest changes on 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/

    Let us know how this goes.

    Thanks, I solved the problem. It was on Hostinger’s end and allowing direct requests to xml files.

    Hello,

    We’re delighted to hear that this issue has been resolved. We appreciate your feedback.

    This ticket will be closed now, but if you ever have another question or need any help in the future, please don’t hesitate to create a new forum topic. We’ll be more than happy to assist you.

    Thank you for choosing Rank Math and have a wonderful day!

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

The ticket ‘Sitemap redirecting to home page outside of WP Admin’ is closed to new replies.