Welcome Guest, Not a member yet? Register   Sign In
404 Error - Wrong Status
#1

[eluser]saiprasad.ch[/eluser]
The "Page Not Found" page does not return the 404 status code...
Instead, it is sending 200 status code.... which is a bug.
I know it can be resolved with a header(), but that should be included in the enxt release.

One more problem I'm facing with CI is :

I use a user-specific menu on every page of my website. But, if a 404 error occured, I even
cant have that menu on that page and not even can i have the user's name... Is there any good solution for this problem???

Currently, im redirecting to "http://www.mysite.com/notfound/" from the "error_404" page...
But, I need a better soln. in such a way that the page url should be present in the address bar..


Thanks in advance.
#2

[eluser]xwero[/eluser]
Are you sure about the 200 status code? In the error_404.php there is the line
Code:
<?php header("HTTP/1.1 404 Not Found"); ?>

For your site problem you can alter the error_404.php content to display whatever you want. You could create a helper function to display the menu.
#3

[eluser]sikkle[/eluser]
does that is known bug ?
#4

[eluser]xwero[/eluser]
I've tested it and i got the 404 message in the response header.
#5

[eluser]Tom Glover[/eluser]
Just tested. 404 in my headers.
#6

[eluser]dreipunktnull[/eluser]
I have to add the 404 header, too. Any news on that?

Regards
#7

[eluser]Derek Allard[/eluser]
[quote author="dreipunktnull" date="1213382980"]I have to add the 404 header, too. Any news on that?[/quote]

News on what? Are you wanting to create a 404 header using CodeIgniter? If so, you can set_header()
#8

[eluser]dreipunktnull[/eluser]
News on why some have to manually add the 404 header and some don't. Not much of a problem of course.

Best regards
#9

[eluser]Derek Allard[/eluser]
I don't know. It doesn't make much sense, maybe some servers are over-riding headers? I've never heard of that before, but I can't imagine why the explicit setting of a 404 header would get ignored.




Theme © iAndrew 2016 - Forum software by © MyBB