I installed a new WordPress site and the RankMath sitemap was not showing (NGINX 404).
It was a custom WordPress install:
sudo site example.com -wp=[true,true,localhost,example_com,example_user,random,xy_] -cache=on
I went through the change logs and saw that from v1.12.0 on, Yoast sitemap support is disabled by default.
I searched the documentation with the search terms "yoast" and "sitemap" but could not find any command to enable Yoast sitemap support.
Is there a command to enable Yoast sitemap support?
If not, here is my solution for anybody who has the same problem:
$ sudo nano /etc/nginx/sites-available/example.com
# Insert this line under # WebinolyCustom
# Save the file
$ sudo nginx -t && sudo service nginx reload
Just for the record: I have found the root cause of this issue.
The XML extension was added as a static file in Webinoly configuration causing issues when this file is dynamically generated as is the case in WordPress.
This issue was introduced in Webinoly v1.17.0 and it will be fixed in the next release v1.17.2.
In the meantime it can be easily fixed just by removing the XML extension from the list, here:
Yoast support was removed a long time ago!
The file you are suggesting as a solution does not exist anymore (unless you have a very old installation).
The Nginx rules for Yoast are not needed anymore, sitemaps should be working without any additional modification.
In case you need to add any custom Nginx conf, just read the documentation to not break any current configuration.
Thank you for your answer!
The installation of Webinoly on this server was in April/May 2021. But I copied some older websites over from another server. The last website I copied over was created in Nov 2020, and it still has the "include common/yoast-sitemap.conf;" in the file.
The file I changed (/etc/nginx/sites-available/example.com) does exist - even for the site I created in January 2023. Also, the yoast-sitemap.conf file exists on my server.
Anyway, the sitemaps from 2 websites I created in July 2022 and January 2023 did not work as of today. I saw it in Google Search Console and manually checked it. Maybe the sitemap from the site I created in July 2022 was working at some time - I did not check it before today. The sitemaps from my older websites all work. And after adding the line as described above, the sitemaps worked.
I do not need any custom Nginx conf, but just the sitemaps.
So, either with my "old" installation of Webinoly, sitemaps are not working without adding the line I described above, or the way I created the websites (sudo site example.com -wp=) breaks the sitemap support.
How can I further investigate this issue?
Not even Yoast knows how to investigate this issue
Not kidding, read: https://twitter.com/jdevalk/status/1163174358111662080
Thank you very much!
I just created 3 new WordPress sites on 2 different servers (but both servers with the same configuration). I installed RankMath and the sitemap did not work.
I then created a custom-nginx.conf file for every site with the code from RankMath:
# START Nginx Rewrites for Rank Math Sitemaps
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
# END Nginx Rewrites for Rank Math Sitemaps
Now, the sitemaps of all 3 sites work!
Thank you very much for your help!
Even better: I put the RankMath code here:
sudo nano /etc/nginx/conf.d/rankmath.conf.srv
So, I don't have to do custom Nginx rules for every new site on my old installation.
Just wondering if I'm the only one with this "problem"?
PayPal · GitHub Sponsors · Bitcoin