关于nginx服务器安装Yoast WordPress SEO: XML Sitemaps插件后出现404错误的解决方案

在/etc/nginx/sites-available/www.yourdomain.com.conf 文件中加入下面代码即可。

rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;

发表评论

邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据