Using this plugin with GSC
-
Hello,
For a very long time, I was using a very old version of this plugin (3.4.1) and disabled auto updates for this plugin as, with this version, it was possible to generate static XML sitemap and easily submit it to Google Search Console. This old version worked flawlessly! However, after upgrading my site to PHP8.2, the old version no longer worked and I had no choice but to upgrade to the latest version of the plugin (4.1.21).
(I have dynamic PHP site with the WordPress blog in /wpblog folder)
When I look at the plugin settings page, I see the following text there:
The URL to your sitemap index file is: https://www.[mysite].com/wpblog/sitemap.xml.
However, when I navigate to this page, I get 404 error. I then noticed these instructions:
Since you are using Nginx as your web-server, please configure the following rewrite rules in case you get 404 Not Found errors for your sitemap:
rewrite ^/.*-misc?\.xml$ "/index.php?xml_sitemap=params=$2" last;
rewrite ^/.*-misc?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
rewrite ^/.*-misc?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
rewrite ^/.*-misc?\.html\.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
rewrite ^/.*-sitemap.*(?:\d\{1,4\}(?!-misc)|-misc)?\.xml$ "/index.php?xml_sitemap=params=$2" last;
rewrite ^/.*-sitemap.*(?:\d\{1,4\}(?!-misc)|-misc)?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
rewrite ^/.*-sitemap.*(?:\d\{1,4\}(?!-misc)|-misc)?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
rewrite ^/.*-sitemap.*(?:\d\{1,4\}(?!-misc)|-misc)?\.html\.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;Hence, I asked the hosting company to apply these rewrite rules. When these rules were applied, instead of the XML sitemap or 404 error page, when I navigate to https://www.[mysite].com/wpblog/sitemap.xml I am now being redirected to the following URL: https://www.[mysite].com/wpblog/wp-sitemap.xml, which, by some strange reason, displays blog homepage instead of the XML sitemap.
Needless to say, that either submission (i.e. of https://www.[mysite].com/wpblog/sitemap.xml or https://www.[mysite].com/wpblog/wp-sitemap.xml) to Google Search Console (GSC) results in “Couldn’t fetch” error.
Any explanations/recommendations?
- You must be logged in to reply to this topic.