Sitemap.xml ALWAYS redirects to sitemap_index.xml

For the life of me i cannot find why it keeps doing it!

removed yoast… still does it purged all caches… still does it checked .htaccess just in case… regular changed themes … still does it commented out yoast of wpcommon… still does it checked on different computers… still does it installed other sitemap plugins… still does it changed servers… still does it checked the log files… no errors other sites on the same server… do not have this issue

I’m at a complete loss on what to do next.

does anyone have any ideas i could check?

thank you VERY much in advance

Hello, if you are using easyengine, you have to remove the lines of the file /etc/nginx/common/wpcommon.conf

`# Yoast sitemap location ~ ([^/])sitemap(.).x(m|s)l$ { rewrite ^/sitemap.xml$ /sitemap_index.xml permanent; rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 last;

Rules for yoast sitemap with wp|wpsubdir|wpsubdomain

rewrite ^./sitemap_index.xml$ /index.php?sitemap=1 last; rewrite ^./([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;

Following lines are options. Needed for WordPress seo addons

rewrite ^/news_sitemap.xml$ /index.php?sitemap=wpseo_news last; rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last; rewrite ^/geo_sitemap.xml$ /index.php?sitemap=wpseo_local last; rewrite ^/video-sitemap.xsl$ /index.php?xsl=video last; access_log off; } `

2 Likes

Why are we forced to use Yoast SEO Plugin?

1- Create a conf file: sudo nano /var/www/example.com/conf/nginx/rewrites.confewrite

2- type this:

rewrite ^/sitemap.xml$ /index.php?the_seo_framework_sitemap=xml last; rewrite ^/sitemap.xsl$ /index.php?the_seo_framework_sitemap=xsl last;

3- sudo ee stack restart

this worked for me, im using the SEO Framework plugin

1 Like

You are not forced to use Yoast, but EE will automatically rewrite the sitemap address to make sure there will not have issues with search engines. But for some plugins, you will have to write your own rules

Hi, i commented out the yoast settings and reloaded nginx, but its still redirecting to the sitemap_index.xml, currently am using google site maps and the xml is on sitemap.xml, what am i missing again