I'm processing unavaliable pages in my custom PHP website. To do this I created a .htaccess file with this single line:
ErrorDocument 404 /index.php
At the beginning of index.php I placed this code:
header($_SERVER['SERVER_PROTOCOL'].' 200 OK', true, 200);
This works perfect in my WAMP environment. I'm checking http headers, and it throws:
Status=OK - 200
But in my Linux hosting I always get:
Status=Not Found - 404
And the weird part is that PHP isn't throwing any error at all... it's like something is overriding my headers.
I need to change the status code header, otherwise IE7 and IE8 won't process my result page. Other browsers can deal with this.
Maybe I need something in .htaccess or php.ini, but haven't found anything related. Or, if you know any other method to redirect a 404 and return 200, let me know.