1. Home
  2. Knowledge Base
  3. SEO Suite
  4. Rank Math XML Sitemaps on NGINX Servers

Rank Math XML Sitemaps on NGINX Servers

Rank Math creates a virtual sitemap dynamically that relies on using redirects on the server-level. In certain situations where your sitemap appears not to be working as intended, you’ll need to add some rewrite rules manually.

To ensure that you need to add these rewrite rules, go to domain.com?sitemap=1. If it loads your sitemap, that means you need to add the rewrite rules.

If your Nginx server is preventing the creation of the sitemap file please try and add the following rewrite rules to your nginx config file to fix this:

# 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

We hope that this article has helped you resolve any potential issues with using Rank Math’s XML Sitemap on servers running Nginx. However, if you are still facing problems or have any queries please feel free to contact our support team and they’d be happy to help you at any given time.

Still not using Rank Math?

Setup takes less than 5 minutes including the import from your old SEO Plugin!

Know more about the PRO Version

Was this article helpful?

Still need help?


Submit Your Question

Please give us the details, our support team will get back to you.

Open Ticket

Related Articles