(Yoast SEO) XML sitemaps on NGINX servers

Discussion in 'ISPConfig 3 Priority Support' started by Benedict, Jan 7, 2025.

  1. Benedict

    Benedict Member HowtoForge Supporter

    The following rewrite rules are provided by Yoast SEO in case the "not nice permalink" (example.com/?sitemap=1) is displayed. I have therefore added the lines to the WordPress-Snippet in ISPConfig. But it still doesn't work and I would like to know how to proceed. There are similar rules for other SEO tools:

    Code:
    # Rewrites for Yoast SEO XML Sitemap 
    rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last; 
    rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
    
    Sources: https://yoast.com/help/xml-sitemaps-nginx/
     
  2. remkoh

    remkoh Active Member HowtoForge Supporter

    The website you provided yourself has all the info you need.
    If it doesn't work you probably have a problem in Nginx which prohibits rewrites.
    What do the webserver logs show?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess the problem might be that you just updated the Nginx snippet. But I guess this will not trigger an update for all sites that use it. Try to change the settings on that site, e.g., quota, and press save to see if the site config gets updated then and contains the new snippet code.
     
  4. Benedict

    Benedict Member HowtoForge Supporter

    We don't need either rule. Everything is fine. Thanks to both of you.
     

Share This Page