Resolved Bug


This bug has been marked as resolved.

404 Error pages does not return the correct status code

Permalink 2 0 Browser Info Environment
In 5.4.0.* and 5.4.1.0 (svn), 404 pages are returned with the status code incorrect status code 200. This is only a problem if ENABLE_LEGACY_CONTROLLER_URLS is set to false (default).

This can be reproduced with a fresh install of concrete5 with sample content. If you visit the urlhttp://path/to/install/index.php/about/press-room/jljlj...... the "page not found" page is shown with the response code 200. This is not the case in 4.3.*.* based installations.

I have found the problem to be the new 404 handling in the controller. If a request is determined by the controller to be invalid, it creates a new PageNotFoundController and renders the 404 page. Unfortunately, the view does not run a controller if it is set on the view before calling its render function, resulting in the status code not being set.

The attached patch, ensures that the PageNotFoundController is run while setting it on the view, before calling the render function. This solution works and should, as far as I can tell, ensure backwards comparability.
Status: Resolved

Still Valid:

This bug is valid a newer version of concrete5. View Current Bug
andrew
View Replies:
Mnkras replied on at Permalink
Mnkras
Yep just tested
Remo replied on at Permalink 1 Attachment
Remo
This still happens with 5.4.2 (see attached screenshot). Is there a reason why this patch hasn't been merged into the core yet?

concrete5 Environment Information

-- pasting from existing bug --

Browser User-Agent String

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; en) AppleWebKit/533.16 (KHTML, like Gecko) Version/4.1 Safari/533.16