How to Fix Yoasts WordPress SEO Sitemap 404 Error

  • fennng 

Just installed Yoasts and enabled sitemap. But then encountered 404 issue.

To fix it, it’s not easy, you need to have access to the php code.

edit .htaccess in your wordpress root folder, add following code

<IfModule mod_rewrite.c>
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]




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