Answer the question
In order to leave comments, you need to log in
How to set up a redirect from sitemap_index.xml to sitemap.xml (wordpress/yoast seo)?
Hello.
Please tell me how to solve the problem. Now the redirect from sitemap_index.xml to sitemap.xml does not work on the hosting. The sitemap is generated using yoast seo. Here is the original data:
# BEGIN XML Sitemaps
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap.xml$ /sitemap_index.xml [R,L]
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
</IfModule>
# END XML Sitemaps
Answer the question
In order to leave comments, you need to log in
Why don't you like site.com/sitemap_index.xml? This sitemap is easily processed by search engines. I wouldn't do anything for a redirect.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question