Welcome to Centmin Mod Community
Register Now

how to configure rewrite rule sitemap setting for rankmath sitemap

Discussion in 'Blogs & CMS usage' started by akbar, May 5, 2020.

  1. akbar

    akbar New Member

    3
    1
    3
    May 5, 2020
    Ratings:
    +1
    Local Time:
    4:55 AM
    1.17
    10.1
    im centmin new user ... and absolutely noob hahaha

    i want to ask, i was using rankmath but it need more setup if using nginx like this pic
    [​IMG]
    where i must insert this code
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,439
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,993
    Local Time:
    7:55 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    from Rank Math Sitemap Issues and Their Fixes » Rank Math

    add into your domain nginx vhost config file /usr/local/nginx/conf/conf.d/newdomain.com.conf for non-HTTPS if it exists and/or if applicable /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf for HTTPS site above the location / {} context
    Code (Text):
    # START Nginx Rewrites for Rank Math Sitemaps
    rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
    rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
    # END Nginx Rewrites for Rank Math Sitemaps
    

    and restart nginx server
    Code (Text):
    service nginx restart

    or via cmd shortcut
    Code (Text):
    ngxrestart
     
  3. akbar

    akbar New Member

    3
    1
    3
    May 5, 2020
    Ratings:
    +1
    Local Time:
    4:55 AM
    1.17
    10.1
    thanks for the answer its fix now :D