Copied to clipboard

Flag this post as spam?

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


  • Stephen 22 posts 195 karma points
    Mar 09, 2017 @ 16:56
    Stephen
    0

    Hello.

    I am having difficulty getting a custom 404 page to work with umbraco. I am using umbraco version 7.3.0. I have tried 2 methods. The first by inserting the nodeid in the UmbracoSettings.config file and secondly by using IContentFinder to find the 404 page and attach it to the ContentLastChanceFinderResolver during the Application Starting method. I have tried adding...

    <httpErrors existingResponse="PassThrough" />
    

    and...

    <httpErrors>
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" prefixLanguageFilePath=""
           path="/page-404-not-found/" responseMode="ExecuteURL" />
    </httpErrors>
    

    to the web.config but with no joy. The error I am getting is to do with the URLTrackerModule. If I use IContentFinder I get this...

    [NullReferenceException: Object reference not set to an instance of an object.] Umbraco.Web.Routing.DefaultUrlProvider.GetUrl(UmbracoContext umbracoContext, Int32 id, Uri current, UrlProviderMode mode) +282 Umbraco.Web.Routing.<>cDisplayClass3.0(IUrlProvider provider) +49 System.Linq.WhereSelectArrayIterator2.MoveNext() +110 System.Linq.Enumerable.FirstOrDefault(IEnumerable1 source, Func`2 predicate) +214 Umbraco.Web.Routing.UrlProvider.GetUrl(Int32 id, Uri current, UrlProviderMode mode) +235 umbraco.library.NiceUrl(Int32 nodeID) +92 InfoCaster.Umbraco.UrlTracker.Modules.UrlTrackerModule.UrlTrackerDo(String callingEventName, Boolean ignoreHttpStatusCode) +1573 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +175 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +988

    and if I use the error404 node in umbracoSettings.config I get...

    [NullReferenceException: Object reference not set to an instance of an object.] Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.

    This works on my local machine which is using IIS 7.5. But I only get these errors on the live server which is using IIS 8.5.

    Any help would be greatly appreciated.

    Thanks.

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Mar 10, 2017 @ 13:41
    Alex Skrypnyk
    0

    Hello Stephen

    Did you try to use Umbraco Page not found manager package? It's pretty good.

    https://our.umbraco.org/projects/backoffice-extensions/umbraco-page-not-found-manager/

    Thanks,

    Alex

  • Stephen 22 posts 195 karma points
    Mar 13, 2017 @ 08:42
    Stephen
    0

    Thanks Alex. I will give this a try.

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Mar 13, 2017 @ 19:26
    Alex Skrypnyk
    0

    Hi Stephen

    Please share with us how it's going, I hope it will work properly for you.

    Thanks,

    Alex

  • Stephen 22 posts 195 karma points
    Mar 14, 2017 @ 14:11
    Stephen
    100

    Hi Alex. We got this working today. Unfortunately although the package you suggested is a great way to handle 404's, it didn't fix the problem.

    We are using Umbraco 7.3.0 which has known problems with the URL Tracker package. It didn't matter which way we tried to redirect to a 404, we kept getting Url Tracker errors.

    So to fix it we uninstalled the Url Tracker package. To do this we had to download the package locally, install it onto the site using the install from local option. This then made the url tracker show up in "Installed Packages" and from here we could uninstall the package.

    The 404's then started working straight away.

    Thanks for the help. Stephen.

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Mar 14, 2017 @ 14:22
    Alex Skrypnyk
    0

    Stephen, Thank you very much for sharing the info about this problem.

    Glad that the problem is solved. Have a nice evening.

    /Alex

Please Sign in or register to post replies

Write your reply to:

Draft