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!
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!
is working on a reply...