NGINX Rewrite Rules for Yoast

My sitemap that is dynamically generated by Yoast SEO is having a conflict with the NGINX server setup. Can someone follow the steps in this article to add rewrite rules so that my sitemap is read correctly: https://kb.yoast.com/kb/xml-sitemaps-nginx/

Thanks

  • Adam Czajczyk
    • Support Gorilla

    Hi Marcus

    I hope you're well today and thank you for your question!

    I don't believe this statement from Yoast docs is quite accurate:

    If you can load and see the sitemap using the non-pretty permalink, your server is not setup to rewrite and, thus, you'll need to add rewrite rules.

    I'm not a nginx expert but the redirects there seem to be actually making it possible to access sitemap via the pretty permalink, not the otherwise. The sitemap - at least via browser - is currently available via two versions of the pretty permalink for your site:

    https://alliantbrokers.com/sitemap.xml
    https://alliantbrokers.com/sitemap_index.xml

    The first one redirects to the second one which shows the list of sitemaps, using pretty permalinks as well - so that's as expected. It doesn't interfere with anything if the site map is also - in addition - available via the "non-pretty" permalink, it's just yet another, additional way to access it.

    Try visiting these URLs via the browser and you should see they are working. However, the Google Search Console not being able to fetch the sitemaps - that's something that still needs to be checked, though it may be related to the initial issue or to something completely different.

    That said, I believe you have submitted the sitemap address to Google Search Console already so which one did you submit there and what are the exact errors/messages that you're getting there?

    Let me know, please.

    Kind regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.