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]
</IfModule>

reference:

https://www.wpbeginner.com/wp-tutorials/how-to-fix-yoasts-wordpress-seo-sitemap-404-error/

 

发表评论

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