🚀 サイト構築が難しい?手取り足取りご案内します——「WordPressサイト構築伴走」サービスを詳しく見る →

Rank Mathサイトマップファイル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
同样的问题:

🚀 チュートリアルを見てもまだ迷っていますか?私が直接手を取ってご案内しましょう

「WordPressサイト構築伴走サービス」——ドメイン名の選択、ホスティングの購入から、Themeのインストール、公開、投稿まで、すべてのステップで私が伴走し、遠回りをせずに目標に直行します。

👉 サイト構築伴走サービスについて詳しく知る
🔒

コメントは閉鎖されました

この記事のコメント機能は閉鎖されています。ご質問がある場合は、他の方法でお問い合わせください。

×
二维码

QRコードをスキャンしてフォロー