The XML sitemap process in the plugin changed. The main sitemap can now be found at /sitemap_index.xml, which you’ll also find in Google Webmaster Tools under “other”.
I could not find ‘other’ on google webmaster but was able to submit sitemap_index.xml successfully.
Hi, I am trying to submit my sitemap to google webmaster tools but a General HTTP error: 404 not found HTTP Error: 404 appears. If I check my sitemap url I can see it: http://ritzycharters.com/sitemap_index.xml
any suggestion?
It works fine as far as i can see.
For me too… but not for google’s webmaster tools
Ah. Found it. Somehow it’s throwing a 404 AND showing the output.
Could you open the following file:
/wordpress-seo/inc/class-sitemaps.php
then find this line:
function output() {
and add this immediately after it:
header( 'HTTP/1.1 200 OK' );
this might fix it, please let me know if it does!
Joost, it worked! Thank you very much. Would you include this in next update? If not I will loose it.
For everyone else, I ALSO added the following to the .htacces:
# WordPress SEO – XML Sitemap Rewrite Fix
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index\.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
</IfModule>
# END WordPress SEO – XML Sitemap Rewrite Fix
This fix, included in version 1.2.6, breaks the sitemaps for our environment (Nginx as loadbalancer talking only HTTP 1.0 to it’s Apache backends), the output has 4 hexdigits added before the content so XML parsing fails.
I also don’t think it’s save to assume all other environments use HTTP 1.1
See http://www.php.net/manual/de/function.header.php#92305 for a similar error report.
I think using
header(“Status: 200”, true);
should be fine.
Else try
header($_SERVER[‘SERVER_PROTOCOL’].’ 200 OK’, true);
but I’m not sure if this variable is set on all webservers, so this should be used after checking the existence and maybe having 1.0 as fallback:
$proto = isset($_SERVER[‘SERVER_PROTOCOL’]) ? $_SERVER[‘SERVER_PROTOCOL’] : ‘HTTP/1.0’;
header($proto.’ 200 OK’, true);
Best regards, hoping to see this fixed in the next version,
J.Schumann
@j_schumann: I’ve implemented both of your suggestions but did not succeed.
But when I unchecked the boxes to ping Yahoo! & Ask.com the sitemap was displayed properly.
The site is running on a multiserver environment with loadbalancer. The backend servers are running with fastcgi.
Did it work with the original version implemented in WP SEO? If not, does it work with the header() function completely commented out? For me it works with no header() at all as well as with header(“Status: 200”, true);
It did not work with the original version. Avoiding all headers did work. At least the xml content was sent.
But reverting to the original file version after the test did result in a strange behaviour. Again I got a 404 for sitemap_index.xml. But now checking the boxes to ping Yahoo! & Ask.com to ON did bring back the sitemap.
There seem to be a strange interference between these two functionalities.