j_schumann
Forum Replies Created
-
I think the target should be to prevent the 404 in the first place instead of overwriting it later as this seems too dependent on the environment. http://www.php.net/manual/en/function.header.php mentions a different notation for FastCGI in the parameter description.
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);
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.SchumannI could not find a bug report for this problem over at photocratis issue tracker so I opened one: https://bitbucket.org/photocrati/nextgen-gallery/issue/104/src-missing-in-sitemapphp
Maybe you want to give it a “+1” so it’ll be fixed soon.
Regards, JS