Rank MathThis is the SEO plugin currently used by Naiba, which includes a sitemap feature. Today, while configuring it for a client, I found that accessing index_sitemap.xml resulted in a 404 error. Here is a record of the solution.
This issue is usually caused by incorrect pseudo-static configuration. Simply add the following rules to the virtual host configuration file. The Nginx configuration is as follows:
# 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;
rewrite ^/([a-z]+)?-sitemap\.xsl$ /index.php?xsl=$1 last;
# END Nginx Rewrites for Rank Math Sitemaps
The Apache configuration is as follows:
# START of Rank Math Sitemap Rewrite Rules
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
# END of Rank Math Sitemap Rewrite Rules
Similar Issue:
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.