So Im happily putting into production a nice newsletter plugin on a customer site.
Its AJAXed, got virtual page for email-response clicks and all..
To my horror the 404 pages on the customer site are displaying non graphical, text only Internet Explorer messages on the virtual page – actually any 404 pages..
I did not detect this behavior with my local IE_Tester, only the live site with the specified browser (IE 6.something) seem’d to have this issue of not letting the 404 pages resolve. (before you moan, Its impossible to upgrade browser or try another on this customer!)
I checked the PHP settings (mod_rewrite was working fine), apache server dident have anything obscure or errors popping out…
The fix. Insert this at the very top of header.php in the WordPress theme
1 |
status_header(200); |
Tip about this obtained from http://www.newnine.com/blog/47-wordpress-404-errors-in-ie
(for those worrying that this will set quirks mode – just make sure theres no spaces before the DOCTYPE)
And this really did the trick. Now WordPress allways return a page status 200 to the browser, and the build in global $wp_query; WordPress functionality will controls the error messages as expected.