联系我们
简单又实用的WordPress网站制作教学
当前位置:网站首页 > WordPress教程 > 正文

Rank Math站点地图文件index_sitemap.xml 404错误解决办法

作者:98wpeu发布时间:2026-03-08分类:WordPress教程浏览:11


导读:RankMath是现在使用的SEO插件,自带了sitemap站点地图的功能,今天在给一个客户配置的时候发现index_sitemap.xml访问提示404错误。记录一下解决办法。...

Rank Math是现在使用的SEO插件,自带了sitemap站点地图的功能,今天在给一个客户配置的时候发现index_sitemap.xml访问提示404错误。记录一下解决办法。

出现这个问题通常都是伪静态没有配置好导致的,只需要把下面的规则添加到虚拟主机的配置文件里面就可以了。

Nginx的配置如下:

# 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

Apache的配置如下:

# 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

同样的问题:

  • All in One SEO Pack插件sitemap.xml 404的解决办法

标签:解决办法错误站点地图


WordPress教程排行
最近发表
网站分类
标签列表