Yoast Seo Sitemap not working


#1

Hi i am using Yoast seo sitemap working url is

http://www.cetcounselling.in/sitemap_index.xml

all page n post urls http://cetcounselling.in are redirecting to http://www.cetcounselling.in

but http://cetcounselling.in/sitemap_index.xml

is not redirecting to

http://www.cetcounselling.in/sitemap_index.xml

can u please nginx code to redirect and location of the file to edit


#2

Hello,

when I click on the links you have posted, I’m able to access to your sitemap. And when I use yourdomain.tld/sitemap.xml, I’m redirected to Yoast sitemap.


#3

http://cetcounselling.in/sitemap_index.xml

CLick on this link it will land u into blank page not redirect to www version


#4

Have you set the redirection from non www to www available in EE tutorials ?


#5

server { server_name “~^(?!www.).*” ; return 301 $scheme://www.$host$request_uri; }

location of the file where we need to keep this

for all domains


#6

You can add those directives in a new file, like redirection.conf in /etc/nginx/conf.d/


#7

https://compareegg.in/sitemap_index.xml

Done the changes as said by you.

But it is not redirecting not working for https version


#8

Edit the file /etc/nginx/conf.d/forcessl-compareegg.in.conf and replace return 301 https://yourdomain.tld$request_uri; by return 301 https://www.yourdomain.tld$request_uri;


#9

Done the same. Not resolved


#10

server { listen 80; server_name www.compareegg.in compareegg.in; return 301 https://www.compareegg.in$request_uri; }

done changes in forcessl-compareegg.in.conf

Still issue not resolved.

added file named allsites.conf in /etc/nginx/conf.d/

server { server_name “~^(?!www.).*” ; return 301 $scheme://www.$host$request_uri; }

still issue not solved.

Is there any correct solution for this.

to make this works https://compareegg.in/sitemap_index.xml to https://www.compareegg.in/sitemap_index.xml


#11

server { listen 80; server_name www.compareegg.in compareegg.in; return 301 https://www.compareegg.in$request_uri; }

done changes in forcessl-compareegg.in.conf

Still issue not resolved.

added file named allsites.conf in /etc/nginx/conf.d/

server { server_name “~^(?!www.).*” ; return 301 $scheme://www.$host$request_uri; }

still issue not solved.

Is there any correct solution for this.

to make this works https://compareegg.in/sitemap_index.xml to https://www.compareegg.in/sitemap_index.xml


#12

Hello,

yes, the last solution is :

 if ($host = yourdomain.tld) {
  return 301 https://www.yourdomain.tld$request_uri;
 }

#14

server { if ($host = compareegg.io) { return 301 https://www.compareegg.io$request_uri; } }

I kept this code in allsites.conf file in the folder conf.d

still not working.


#15

No, add it in /var/www/compareegg.io/conf/nginx/redirect.conf

Without server block


#17

Yes Done the same. But no use.

I think some Issue there.

Even i use google xml sitemap it is redirecting to yoast sitemap url in other sites.


#18

to disable yoast rewrite rules, you can comments the directives listed in /etc/nginx/common/wp-common.conf or wp-common-php7.conf

But personally, I’m redirected to www when I visit : http://cetcounselling.in/sitemap_index.xml


#20

For http it is working fine. for https it is not working.

http://compareegg.in/sitemap_index.xml is redirection to https://www.compareegg.in/sitemap_index.xml

http://www.compareegg.in/sitemap_index.xml

is redirecting to https://www.compareegg.in/sitemap_index.xml

but

https://compareegg.in/sitemap_index.xml

is not redirecting. [no redirects found]

where as wordpress urls redirecting

https://compareegg.in/hyundai-hs4f33-gcr-cm-1-ton-3-star-split-ac-price/ perfectly redirecting to https://www.compareegg.in/hyundai-hs4f33-gcr-cm-1-ton-3-star-split-ac-price/

Hope the issue with https connection might be yoast seo rule

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;

causing the issue. even i tried removing it still not working


#21

You can also perform the redirection by adding a page rule with Cloudflare.


#22

I have many sites not using cloudflare.


#23

Sir Is there any solution to resolve the yoast seo sitemap redirection issue for https (ssl) sites.