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