![]() |
404 error page returns a status of 200 in the header - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: 404 error page returns a status of 200 in the header (/showthread.php?tid=2868) |
404 error page returns a status of 200 in the header - El Forum - 08-28-2007 [eluser]Danilo Stern-Sapad[/eluser] I've checked the headers on pages that are supposed to return a 404 error and they return "HTTP/1.1 404 Not Found", which is the desired and expected behavior. However, for those familiar with Google Webmaster Tools, if I try to verify my site ownership for the Google Sitemaps application by uploading a file (e.g. google4a61g765e7b98d37.html) to the CodeIgniter root directory, Google gives me the following error: Verification status: NOT VERIFIED We've detected that your 404 (file not found) error page returns a status of 200 (Success) in the header. Not sure if this is a bug or due to my own oversight or improper implementation of the show_404 function. Anyone have any ideas what's causing this? Am I using the show_404 function incorrectly? I tried sticking the path into the function but Google gave me the same error, so right now I just call it like so: Code: show_404(); Any help would be greatly appreciated. Thanks! ![]() 404 error page returns a status of 200 in the header - El Forum - 08-28-2007 [eluser]BravoAlpha[/eluser] [quote author="Danilo Stern-Sapad" date="1188366907"]Not sure if this is a bug or due to my own oversight or improper implementation of the show_404 function. Anyone have any ideas what's causing this?[/quote] Looking in Exceptions.php, I don't see anything about an actual 404 header... 404 error page returns a status of 200 in the header - El Forum - 08-28-2007 [eluser]Danilo Stern-Sapad[/eluser] So do I need to explicitly specify: Code: header("HTTP/1.1 404 Not Found"); 404 error page returns a status of 200 in the header - El Forum - 08-28-2007 [eluser]Danilo Stern-Sapad[/eluser] I found the problem my permitted URL characters in my config.php file were too restrictive, so when Google saw my 404 pages it was getting the "The URI you submitted has disallowed characters." message from the Router.php library file, which returns a 200 OK. I just changed my allowed URI characters back to the default and everything is fine. :-) |