-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom 404 page returning 200 status code #14000
Comments
Hi there @mattwootton! Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better. We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Just for reference, this bug was introduced in 11.2.0, and a fix is scheduled to be released in 11.3.0. My issue can be seen here: #13907 The issue can be hotfixed by manually setting the status code to 404 - eg. in the template of the 404 page:
In this example, the 404 page could be a normal page that happen to be used as the 404 page, so checking against the key allows us to only set the status code for the 404 page, and not other pages using the same template. |
Ah, thanks for making me aware. Hadn't spotted that and it didn't show up in a search of the issue tracker but think I was only searching open issues and yours has been closed. Yep we are able to manually update but it's a pain as like you we are using a standard template for the 404 page that is used by other pages. I'll close this down then as good to hear a fix is already underway. |
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
11.2.1
Bug summary
In the latest Umbraco 11 version we have noted that custom 404 pages set through the "Error404Collection" content setting via appsettings.json return a 200 status code rather than 404. This was first picked up due to redirects added via the Skybrud Redirects package were not working and we determined this was due to the page returning a 200 status code.
The default Umbraco 404 page template does return a 404 status code but if you provide your own custom page the status code instead returns a 200 for any missing page.
Obviously we can manually set the status code in the template of the page configured for the 404 page but ideally this should be automatic and I believe this as the case in v10 and earlier versions of Umbraco.__
Specifics
Example sites:
https://www.themoleresort.co.uk/nothere
https://www.sprintvalley.com/nothere (this is an Umbraco Cloud site)
Steps to reproduce
Expected result / actual result
Expect the status code to be 404
The text was updated successfully, but these errors were encountered: