Copied to clipboard

Flag this post as spam?

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


  • Matthew Bettesworth 14 posts 35 karma points
    Sep 01, 2010 @ 11:34
    Matthew Bettesworth
    0

    Switching off 404 hander

    HI,

    Is there any way I can switch off the 404 handler provided by Umbraco? If this isn't possible / recommended, is there any way to get Umbraco to capture other types of error (i.e. 500)?

    Thanks,
    Matt

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Sep 01, 2010 @ 12:15
    Richard Soeteman
    0

    HI Matt,

    You can write your own implementation of the 404 based on The INotFound Interface and configure that in the 404Handlers config file buit why you wnat to do that, I'm pretty sure there is a better way to solve teh problem your are facing.

    Cheers,

    Richard

  • Matthew Bettesworth 14 posts 35 karma points
    Sep 01, 2010 @ 12:28
    Matthew Bettesworth
    0

    Hi Richard,

    Thanks for getting back to me so quickly.

    All I really wanted was to keep all my error pages together and looking consistent. I don't mind if they are all in Umbraco or if they are static pages on the file system (set with customErrors tag in web.config).

    Do you have any ideas/best practices that will help with this?

    Thanks again,

    Matt

     

     

     

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Sep 01, 2010 @ 12:31
    Stefan Kip
    0

    You can also just remove the handle404 entry in the 404Handlers.config and handle everything yourself with the ASP.NET/IIS way :-)

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Sep 01, 2010 @ 12:36
    Richard Soeteman
    0

    That might be better in your case since yoiu want to have 1 file, make sure it's a HTML file otherwise your 500 error page can cause an error :P

    Cheers,

    Richard

  • Matthew Bettesworth 14 posts 35 karma points
    Sep 01, 2010 @ 12:44
    Matthew Bettesworth
    0

    I've just deleted the following line from the 404handlers.config file, and it doesn't seem to have made any difference:

        <notFound assembly="umbraco" type="handle404"/>

    I still get the Umbraco file not found message. What am I doing wrong???


    Thanks,

    Matt

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Sep 01, 2010 @ 12:44
    Richard Soeteman
    0

    I think you need to reset IIS

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Sep 01, 2010 @ 12:45
    Stefan Kip
    0

    I'd say 'touch' the web.config ;-)

  • Matthew Bettesworth 14 posts 35 karma points
    Sep 01, 2010 @ 13:25
    Matthew Bettesworth
    0

    Sorry to be a bit dim about all this...

    I've removed the line from the file, touched the web.config, restarted IIS fully and I'm still getting the Umbraco 404 page:

    --

    Page not found

    No umbraco document matches the url 'http://dev.southsomerset.gov.uk/asdfasdf'

    umbraco tried this to match it using this xpath query'/root/node [@urlName = "asdfasdf"] | /root/node/node [@urlName = "asdfasdf"]')

    This page can be replaced with a custom 404 page by adding the id of the umbraco document to show as 404 page in the /config/umbracoSettings.config file. Just add the id to the '/settings/content/errors/error404' element.

    For more information, visit information about custom 404 on the umbraco website.

    This page is intentionally left ugly ;-)

    --

     

    Please help, I'm going mad...
    Matt

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Sep 01, 2010 @ 13:38
    Stefan Kip
    0

    Beats me...

    If it's an option for you, you could handle 404 with using Umbraco?
    http://our.umbraco.org/forum/using/ui-questions/4541-This-page-is-intentionally-left-ugly-%29---Umbraco-404-error-page

  • Matthew Bettesworth 14 posts 35 karma points
    Sep 02, 2010 @ 10:30
    Matthew Bettesworth
    0

    Hi again,

    Can anyone confirm which pipeline mode I should be using for my app pool please? I'm running Windows 2008/IIS7 with .NET 3.5 on Umbraco 4.0.3.

    The reason I ask this is because I'm not sure if there are additional configuration issues at play here. When I use integrated mode, I can't get their handler to work at all. If I use Classic.NET mode, I can't stop it from displaying (i.e. can't make it use my own page).

    I have added a handler mapping for all requests that points to \aspnet_isapi.dll. This was done to allow friendly URL's to work.

    Cheers,

    Matt

     

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Dec 02, 2010 @ 22:41
    Stefan Kip
    0

    Just found out umbraco's 404 error page is also hard-coded in umbraco.UmbracoDefault (code-behind of default.aspx).
    Also if you disable the handle404 handler in 404handlers.config, you get an error with 4.5.2:

     

    Object reference not set to an instance of an object.

    [NullReferenceException: Object reference not set to an instance of an object.]
    umbraco.requestHandler..ctor(XmlDocument umbracoContent, String url) +3879
    umbraco.UmbracoDefault.Page_PreInit(Object sender, EventArgs e) +2558
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +24
    System.EventHandler.Invoke(Object sender, EventArgs e) +0
    System.Web.UI.Page.PerformPreInit() +48
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1699

Please Sign in or register to post replies

Write your reply to:

Draft