Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Griffiths 826 posts 1269 karma points c-trib
    Mar 14, 2023 @ 14:20
    Martin Griffiths
    0

    Umbraco 9-11 custom error page gotcha!

    This is more for developer information than anything else but it had me scratching my head for a bit!

    No matter what I tried, I couldn't get an appsettings configured 404 collection to work in my Umbraco 11 build either locally or in Azure! I just kept seeing the default page.

    So, I resorted to adding a custom IContentLastChanceFinder which used DI to bring in the domainService and umbracoContextAccessor, but that failed too...Time for a breakpoint!

    I noticed the domainService was coming back null and the penny dropped! I hadn't added/configured a domain in the backoffice under "Cultures and Hostnames" for the root of my site which solved the problem, 404 pages now working!

    So....remember to add a domain (you will for live) and one for your localhost too!

Please Sign in or register to post replies

Write your reply to:

Draft