Sitemap.xml -redirect to sitemap_index.xml in plugin oder cp

Hallo,

I don’t know if this is the right place to ask whether the redirect from sitemap.xml to wp-sitemap.xml should first be done via the redirection tool from the plugin to index_sitemap.xml or whether it should already be done better in cp itself.

Then maybe another question :-):

So far I have created the sitemap.xml with screaming-frog. However, I think the option via the SEO plugin is nicer (the division into pages, posts and tags…) or more practical (faster) for various reasons. What would you advise: is the route via screaming-frog e.g. B. preferable for performance reasons?

Thanks for help and suggestions!

Greetings
Soenke

You can put this in your root .htaccess file, somewhere above the default entry.

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/sitemap(.*)$
RewriteRule .* /wp-sitemap.xml [R=301,L]

With the default entry I mean this section, which is automatically created by ClassicPress.

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.