• Resolved Lordon

    (@popi0)


    Hello,

    when Yoast Sitemap is disabled, then sitemap.xml redirects to wp-sitemap.xml correctly

    but when Yoast Sitemap is enabled then I have a 404 Error on sitemap.xml that redirects to wp-sitemap.xml again and to sitemap_index.xml

    What is wrong? Thx

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Jerlyn

    (@jerparx)

    Hi @popi0 ,

    We are sorry to hear about the difficulties you are having. Let’s have a look on what’s going on with your setup.

    Can you share your sitemap URL? How was the redirect from sitemap.xml created?

    Since Yoast SEO v14.7, requests to pull up wp-sitemap.xml gets redirected to sitemap_index.xml as explained in this article.

    Thread Starter Lordon

    (@popi0)

    I have to make a correction:

    When Yoast Sitemap is enabled: sitemap.xml –> wp-sitemap.xml: 404 Error

    Drectly Access to sitemap_index.xml is working

    When Yoast Sitemap is disabled:
    sitemap.xml –> wp-sitemap.xml: Core-Sitemap.xml is working

    Now i have placed some code in htaccess so that sitemap.xml can redirect to sitemap_index.html

    But this is not the right solution to use code in htacces for that.

    I will send u the Link

    Plugin Support Suwash

    (@suascat_wp)

    Since Yoast SEO 14.5, we automatically turn off the default XML sitemap in WordPress and make sure that ours runs flawlessly.

    We recommend you to disable sitemap.xml first on your site.

    Once you disable the relevant sitemap.xml, the sitemap.xml should automatically redirect you to the sitemap_index.xml that is generated by the Yoast SEO plugin for you.

    Can you please try that and let us know?

    Thread Starter Lordon

    (@popi0)

    oh ok. it is working.

    i added

    add_filter( ‘wp_sitemaps_enabled’, ‘__return_false’ );

    in functions.php

    Now why Yoast SEO (Last Update) is not turning my core sitemap.xml automatically off?

    Whats the Problem?

    Hi,

    When you have Yoast’s sitemaps active on the site the expected result is that wp-sitemap.xml and sitemap.xml both get redirected to the Yoast sitemap: sitemap_index.xml. See images which show the redirect: https://ibb.co/88DPncN and https://ibb.co/D4ct4xs.

    If that is not happening then there is an issue on the site that needs some additional investigation.

    When you added the filer: add_filter( ‘wp_sitemaps_enabled’, ‘__return_false’ ); it likely made some changes to a redirect process that was not working to begin with.

    We would like some more information.

    1. Can you confirm you are using WordPress 5.6? You can check by clicking on the W in the top left and selecting About. If you need to update, please check with your host provider.?Please know that if you are using an older version of WordPress Core you may experience unexpected behavior with Yoast.?This guide explains more:?https://yoast.com/why-we-dont-support-old-wordpress-versions/.

    2. Are all your non-Yoast plugins and themes also updated?

    3. We had another recent release. Can you confirm you are using the most recent Yoast SEO Premium, v15.4? If you update, does the issue resolve?

    4. Does clearing your caching from your theme, plugin, server, CDN like CloudFlare or browser resolve the issue? If you are not sure how to clear caching from theme/plugin please speak to those authors. If you want to clear cache from the server, please speak to your host provider. To clear the cache from a browser use this guide: https://yoast.com/help/how-to-clear-my-browsers-cache/

    5. Can you provide us a copy of your htaccess file? You can copy/paste it here. We ask as there may be a clue in the file that is preventing the sitemaps from redirecting.

    6. If you remove that filter and keep the Yoast sitemaps enabled and then visit: sitemap.xml and wp-sitemap.xml do they both show 404 or do they both redirect to sitemap_index.xml as shown in the above images?

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘sitemap.xml redirect to sitemap_index.xml broken’ is closed to new replies.