Nginx Rewrite rules for Rank Math Sitemap in Plesk

If you are using an Nginx server to run and cache your site you might encounter a sitemap error on your rank Math sitemap setting. Rank Math will notify you of the error indicating that the Nginx caching prevents the creation of your website’s sitemap. It will prompt you to add an additional manual rewrite rule on your server to fix the issue.

Nginx Rewrite rules for Rank Math Sitemap in Plesk

Related: How to fix cURL error 7 failed to connect to Port 443

How to enable Nginx rewrite rules in Plesk?

To enable the Nginx rewrite rule in Plesk you will need to follow these steps

  1. Login into your Plesk control panel
  2. Click on your domain and then the “Hosting & DNS” button
Nginx Rewrite rules for Rank Math Sitemap in Plesk
  1. Under the “Hosting & DNS” button, click on the “Apache and Nginx setting” option. This will take you to a new page where you can rewrite Nginx rules to resolve Rank Math sitemap issue.
  2. On this page scroll to the bottom until you see the “Additional Nginx directives” option.
Nginx Rewrite rules for Rank Math Sitemap in Plesk
  1. Add the following code to exclude the Rank Math sitemaps from getting cached on the Nginx server. Click on the “ok or apply” button to save the changes you made.
# 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

What to do after enabling Nginx rewrite rules for Rank Math Sitemap in Plesk?

Once you have made the rewrite rules there are a few things you need to do for the changes to take effect. This includes the following:

Related: Cheapest web hosting providers for all business categories

Flush your Rank Math sitemap settings

To do this, on your WordPress dashboard sidebar head over to “Rank Math”, then “sitemap settings”. Now make some minor changes on the link per sitemap option and then save changes. Usually, the number of sitemap links is set to 200 by default, you can change that to 210 and save.

Nginx Rewrite rules for Rank Math Sitemap in Plesk

Flush your website permalinks setting

Again, on your WordPress admin dashboard head over to settings and choose the permalinks option. Do not alter your permalinks setting just click the save button to prompt a change in your sitemap.

Nginx Rewrite rules for Rank Math Sitemap in Plesk

Purge cache on CDN

If you have integrated your website to a CDN such as Cloudflare consider purging everything to force Cloudflare to fetch a new version of your site’s data.

Login into your Cloudflare dashboard and chose the domain name associated with your website. On the left side sidebar, click on the “purge cache” option and choose the “purge everything” button to clear your site’s saved cache.

Nginx Rewrite rules for Rank Math Sitemap in Plesk

Submit sitemap on search console

Now that you have made the changes and corrected the error that previously prevented the creation of a sitemap, it is time to submit a fresh sitemap to the search console for indexing. That’s all. You have successfully enabled Nginx rewrite rules for Rank Math Sitemap in Plesk without touching any code.

Disclosure: We may earn commission for purchases that are made by visitors on this site at no additional cost on your end. All information is for educational purposes and is not intended for financial advice. Read our affiliate disclosure.

Share this:

Similar Posts

  • Best image optimization plugins

    Image optimization is an important aspect of SEO. Images can often slow down a website and negatively impact its loading speed. By optimizing them, you can improve the performance of your site, which can lead to higher search engine rankings and increased traffic. There are several WordPress plugins that can help you optimize images on…

  • Geo Targeting SEO: How to Boost Local Visibility & Conversions

    Geo Targeting SEO: How to Boost Local Visibility & Conversions The Complete Guide to Location-Based Search Optimization Table of Contents 1. Introduction to Geo Targeting SEO 2. Understanding Geographic Search Behavior 3. Core Geo Targeting SEO Strategies 4. Essential Tools and Technologies 5. Implementation Best Practices 6. Measuring and Optimizing Performance 7. Real-World Case Studies…

  • How to enable TLS 1.2 and TLS 1.3 in Linux?

    Have you been wondering how to enable TLS 1.2 and TLS 1.3 in Linux? TLS (Transport Layer Security) is a cryptographic protocol that provides secure communication over the internet. It is used to establish secure connections between clients and servers, and it is used to encrypt data transmitted between them. There are several versions of…

  • Website Uptime Monitoring: A Step-by-Step Guide

    Website Uptime Monitoring: A Step-by-Step Guide Master the art of keeping your website online 24/7 with comprehensive monitoring strategies, tools, and implementation techniques that protect your business from costly downtime. JoshWP Team | Updated on January Table of Contents 1. Introduction to Website Uptime Monitoring 2. Why Website Uptime Monitoring Matters 3. Industry Statistics and…

  • How to optimize your WordPress site: The Easy way

    Is your website slow and looking for a way on how to optimize your WordPress site to improve performance? Optimizing the speed and performance of your WordPress website is important for a number of reasons. A fast-loading website not only provides a better user experience, but can also improve your search engine rankings, increase conversions,…

  • How to Use Geolocation Features on Your Website to Increase Conversions

    How to Use Geolocation Features on Your Website to Increase Conversions Master the art of location-based personalization to boost your website conversions by up to 300%. This comprehensive guide covers implementation strategies, statistical insights, and proven techniques. Table of Contents 1. Introduction to Geolocation and Conversions 2. Statistical Impact of Geolocation on Conversions 3. Types…

Leave a Reply

Your email address will not be published. Required fields are marked *