Hi all. I have not seen any posts about best practice in 7.5 and above for properly configuring custom 404 handling. Someone in the know, please update this as the old way of writing into the web.config seems to break now.
Thanks for your response Morten. I don't think that site designers/developer should have to modify and compile code for something as simple as setting up 404 handling. At least, I don't think of it as simple. I don't feel that this counts as a "best practice" approach, but I guess it is a way of doing it.
Surely there is an easier method. There has to be a .config file approach that works.
Morten, I am having the same problem. I have created a 404 page with the ID of 1114.
I have modified my umbracoSettings.config as below:
<errors>
<error404>1</error404>
<!--
The value for error pages can be:
* A content item's integer ID (example: 1234)
* A content item's GUID ID (example: 26C1D84F-C900-4D53-B167-E25CC489DAC8)
* An XPath statement (example: //errorPages[@nodeName='My cool error']
-->
<!--
<error404>
<errorPage culture="default">1</errorPage>
<errorPage culture="en-US">200</errorPage>
</error404>
-->
<error404>1114</error404>
</errors>
and added
<httpErrors existingResponse="PassThrough" />
to my web.config - but I still get a blank, deliberately untidy 404 page.
Having posted this I can now see my error in black and white! So I think it is worth leaving here. Tip: the web-server uses the first <error404/> it comes to, in this case page ID 1 :)
I recently discovered that if I configure the umbracoSettings.config file as follows, it works:
<content>
<errors>
<error404>1968</error404>
If you replace the "1968" with the numerical page ID of your custom 404 page, then you will be able to have your error page handle the errors.
William Charlton
Your issue is that you did not replace the default value of 1 in the second line of your sample. That line has to be replaced with your ID as follows:
Umbraco 7.5 Custom 404 Handling
Hi all. I have not seen any posts about best practice in 7.5 and above for properly configuring custom 404 handling. Someone in the know, please update this as the old way of writing into the web.config seems to break now.
The resource page has not been completed: https://our.umbraco.org/documentation/Reference/Config/404handlers/
I think you're looking for the IContentFinder interface
https://our.umbraco.org/documentation/reference/routing/request-pipeline/icontentfinder
Thanks for your response Morten. I don't think that site designers/developer should have to modify and compile code for something as simple as setting up 404 handling. At least, I don't think of it as simple. I don't feel that this counts as a "best practice" approach, but I guess it is a way of doing it.
Surely there is an easier method. There has to be a .config file approach that works.
I saw this a couple of days ago if it helps https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/83942-custom-404-error-page-s-multi-site
In the umbracoSettings.config there is an Errors section
https://our.umbraco.org/documentation/Reference/Config/umbracoSettings/#errors
That lets you define content pages that should be shown if no content was found.
Is that the kind of thing you're looking for?
Morten, I am having the same problem. I have created a 404 page with the ID of 1114. I have modified my umbracoSettings.config as below:
and added
to my web.config - but I still get a blank, deliberately untidy 404 page.
Having posted this I can now see my error in black and white! So I think it is worth leaving here. Tip: the web-server uses the first
<error404/>
it comes to, in this case page ID 1 :)I recently discovered that if I configure the umbracoSettings.config file as follows, it works:
If you replace the "1968" with the numerical page ID of your custom 404 page, then you will be able to have your error page handle the errors.
William Charlton Your issue is that you did not replace the default value of 1 in the second line of your sample. That line has to be replaced with your ID as follows:
Can't believe it took me this long to figure out. I think that the content of the https://our.umbraco.org/documentation/Reference/Config/umbracoSettings/#errors page is not explicit enough in explaining how this works.
is working on a reply...