Part of the EllisLab Network
   
 
404 Error - Wrong Status
Posted: 22 May 2008 05:04 AM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  4
Joined  05-22-2008

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.

Profile
 
 
Posted: 22 May 2008 05:16 AM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
RankRankRankRankRank
Total Posts:  2858
Joined  07-14-2006

Are you sure about the 200 status code? In the error_404.php there is the line

<?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.

Profile
 
 
Posted: 22 May 2008 08:18 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
RankRankRank
Total Posts:  398
Joined  05-21-2007

does that is known bug ?

 Signature 

-> None official irc channel [ irc.freenode.net #codeigniter ]

Profile
 
 
Posted: 22 May 2008 08:29 AM   [ Ignore ]   [ # 3 ]  
Sr. Research Associate
RankRankRankRankRank
Total Posts:  2858
Joined  07-14-2006

I’ve tested it and i got the 404 message in the response header.

Profile
 
 
Posted: 22 May 2008 10:19 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  569
Joined  01-13-2008

Just tested. 404 in my headers.

 Signature 

Yonti - Hosting Now Available - Site On it’s Way - CI Powered
Babblemap - Moved, Please Update RSS links. - Still using inkType

Profile
 
 
Posted: 13 June 2008 08:49 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  4
Joined  02-29-2008

I have to add the 404 header, too. Any news on that?

Regards

Profile
 
 
Posted: 13 June 2008 01:41 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6507
Joined  03-23-2006
dreipunktnull - 13 June 2008 08:49 AM

I have to add the 404 header, too. Any news on that?

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

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

Profile
 
 
Posted: 14 June 2008 03:22 AM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  4
Joined  02-29-2008

News on why some have to manually add the 404 header and some don’t. Not much of a problem of course.

Best regards

Profile
 
 
Posted: 14 June 2008 07:18 AM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6507
Joined  03-23-2006

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.

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 61065 Total Logged-in Users: 18
Total Topics: 73886 Total Anonymous Users: 1
Total Replies: 398532 Total Guests: 308
Total Posts: 472418    
Members ( View Memberlist )