Copied to clipboard

Flag this post as spam?

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


  • Jonathan Roberts 336 posts 938 karma points
    Jan 02, 2018 @ 13:56
    Jonathan Roberts
    0

    Hi,

    I am trying to create a custom 500 error page to capture something like:

    https://yourwebsite.com/c:/boot.ini

    I have set up the webconfig to match:

    <customErrors mode="RemoteOnly" redirectMode="ResponseRewrite" defaultRedirect="~/500.aspx">
    

    <httpErrors errorMode="DetailedLocalOnly">
    

    But it doesnt seem to capture this url Internal error,

    Jon

  • W3S 30 posts 150 karma points
    Jan 02, 2018 @ 14:02
    W3S
    0

    Hi Jonathan,

    You could try

    customErrors:

    <customErrors defaultRedirect="500.aspx" mode="RemoteOnly">
      <error statusCode="500"
            redirect="500.aspx"/>
    </customErrors>
    

    Note that by setting the mode flag to RemoteOnly you'll not get to see the 500 page on your local/develop environment.

    httpErrors:

    <httpErrors existingResponse="PassThrough" />
    
  • Jonathan Roberts 336 posts 938 karma points
    Jan 02, 2018 @ 14:06
    Jonathan Roberts
    0

    Hi,

    No - this hasn't worked. One thing that may help - the site is hosted on Azure - do you think there maybe something overriding this?

    Jon

  • W3S 30 posts 150 karma points
    Jan 03, 2018 @ 09:10
    W3S
    0

    Hi Jonathan, Could be but unfortunately I don't really have that much experience with umbraco sites hosted on Azure. Few things I could think of not Azure related:

    • did the application restarted whilst editing the web.config?
    • can you find anything related to this issue in the log files?
  • W3S 30 posts 150 karma points
    Jan 03, 2018 @ 09:26
    W3S
    0

    You could also try using the httperrors elements. Examples:

    ExecuteURL serves dynamic content such as an .aspx page (the path value has to be a server relative URL):

    <httpErrors errorMode="Custom" existingResponse="Auto" defaultResponseMode="ExecuteURL" >
        <remove statusCode="500"/>
        <error statusCode="500" responseMode="ExecuteURL" path="/500.aspx" />
    </httpErrors>
    

    File serves a custom error file, such as a .html page:

    <httpErrors errorMode="Custom" existingResponse="Auto" defaultResponseMode="File" >
        <remove statusCode="500"/>
        <error statusCode="500" path="500.html" />
    </httpErrors>
    
  • Jez Reel R. Maghuyop 20 posts 62 karma points
    Jun 06, 2019 @ 02:16
    Jez Reel R. Maghuyop
    0

    Would it be possible to use an Umbraco Content for the 500 error message as well? just like for 404 error.

  • andy 20 posts 89 karma points c-trib
    Jun 06, 2019 @ 10:43
    andy
    0

    You can make 500 pages which pull from Umbraco but I would not advise it.

    If there is an error in your application then trying to pull content from Umbraco or do anything dynamic may fail also. I've had a situation previously where the 500 page itself was erroring which caused a loop!

    We always tend to do static 500 pages for this reason.

  • Dan Diplo 1463 posts 5630 karma points MVP 3x c-trib
    Jun 06, 2019 @ 08:24
    Dan Diplo
    0

    Hi. This is what I use and it works on Azure:

    There are two places you need to configure in web.config. The first is in system.webServer...

      <system.webServer>
    
        <httpErrors errorMode="Custom">
          <remove statusCode="500" subStatusCode="-1" />
          <error statusCode="500" path="500.aspx" responseMode="ExecuteURL" />
        </httpErrors>
    

    and then in System.Web ...

      <system.web>
    
        <customErrors mode="RemoteOnly" defaultRedirect="~/500.aspx" redirectMode="ResponseRewrite" />
    

    As mentioned, for testing locally change mode from RemoteOnly to Off.

  • andy 20 posts 89 karma points c-trib
    Jun 06, 2019 @ 10:35
    andy
    0

    Are you getting a default IIS 500 page instead of your custom one? If so, what is trySkipIisCustomErrors set to in your umbracoSettings.config? If this is set to false then this may be your issue https://our.umbraco.com/Documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Nested-Content/index-v7

Please Sign in or register to post replies

Write your reply to:

Draft