Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I'm currently using Umbraco 7.4.3.
I have the following:
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { ContentLastChanceFinderResolver.Current.SetFinder(new _404iLastChanceFinder()); base.ApplicationStarting(umbracoApplication, applicationContext); }
and
public bool TryFindContent(PublishedContentRequest contentRequest) { if (contentRequest.Is404) { var root = contentRequest.RoutingContext.UmbracoContext.ContentCache.GetAtRoot().Single(x => x.DocumentTypeAlias == "domain"); var notFoundNode = root.Children.Single(x => x.DocumentTypeAlias == "404ErrorPage"); contentRequest.SetResponseStatus(404, "404 Page Not Found"); contentRequest.PublishedContent = notFoundNode; } return contentRequest.PublishedContent != null; }
On the production server, running IIS 7.5, it finds the proper nodes, but it displays the default .NET 404 error page and not the notFoundNode.
On my developer machine with IIS Express it works as intended.
Any help will be much appreciated.
Best regards Morten
Hi Morten
Have a look in your config/umbracosettings.config file on your production server and find:
<web.routing trySkipIisCustomErrors="false" internalRedirectPreservesTemplate="false" disableAlternativeTemplates="false" disableFindContentByIdPath="false" umbracoApplicationUrl=""> </web.routing>
what is the value of trySkipIisCustomErrors ? set this to true, and it should IIS to 'back off' when serving 404 for your site...
Hi Marc
Thank you very much, that was exactly what I needed.
Pro tip: this is also part of one of the health checks, so if you're on 7.5+ you could easily see what you need to tweak on your live environment:
Thanks for the tip, I will definitely be using health check when I start using 7.5+.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
IContentFinder not working on production server
Hi
I'm currently using Umbraco 7.4.3.
I have the following:
and
On the production server, running IIS 7.5, it finds the proper nodes, but it displays the default .NET 404 error page and not the notFoundNode.
On my developer machine with IIS Express it works as intended.
Any help will be much appreciated.
Best regards Morten
Hi Morten
Have a look in your config/umbracosettings.config file on your production server and find:
what is the value of trySkipIisCustomErrors ? set this to true, and it should IIS to 'back off' when serving 404 for your site...
Hi Marc
Thank you very much, that was exactly what I needed.
Pro tip: this is also part of one of the health checks, so if you're on 7.5+ you could easily see what you need to tweak on your live environment:
Thanks for the tip, I will definitely be using health check when I start using 7.5+.
is working on a reply...