Home Experience & Tips Sharing Standard Post

Standard Post

Solution for Rank Math sitemap file index_sitemap.xml 404 error.

Rank Math is the SEO plugin Naiba currently uses. It comes with a sitemap feature. Today, while configuring it for a client, I found that accessing index_sitemap.xml returned a 404 error. Here is the solution. This problem is usually caused by incorrect pseudo-static settings. Just add the following rules to the virtual host configuration file...

Updated on July 11, 2023 About 2 minutes read
Rank Math站点地图文件index_sitemap.xml 404错误解决办法

Rank Mathis the SEO plugin currently used by Naiba. It comes with a built-in 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, just add the following rules to the virtual host configuration file.

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:

2.2/5 - (17 votes)
Previous Beginner Q&A: Does having WordPress mean you don't need to buy a domain name and such? Continue reading content around the same timeline. Next Genuine Free Download of WordPress Enterprise Theme SohoPro Suitable for Creative Product Display View the next related tutorial or experience.

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: