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/