XML Sitemap Giving 404 Error!

I’m using Google XML Sitemap plugin to generate sitemaps and these sitemap pages are giving me 404 errors. Now I need to implement the codes shown below but I’ve no idea how to do this.
Can anyone tell me how do I do it?

3 Likes

I haven’t heard about this plugin, I recommend you to use Yoast plugin.

3 Likes

You can use Yoast SEO plugin, enable sitemap. It works fine at the NGINX server.

3 Likes

I never tried this plugin, Recommend you to use Yoast SEO or RankMath to generate Sitemap.

1 Like

But I’ve been using All In One Seo Pack from 4 years. I find it better than Yoast. What to do!

You can activate XML Sitemaps in the All in One SEO Feature Manager.

2 Likes

Yes, tried it but no luck. It’s also giving 404 error.

1 Like

Install Yoast SEO plugin, you can migrate to it.

Okay. Still I Just want to know what’s the procedure of adding the code (rewrite rules).

:warning: Before you proceed, take server backup. You should consult any developer to get it done properly.

Check your server block and add there …

sudo -s
cd /etc/nginx/sites-available/ && vdir
nano example-site-server-block

Add code under server block

server {
    ...

    rewrite rules goes here
    ...
}

Test

nginx -t

Reload

service nginx reload
2 Likes