<httpErrors errorMode="Custom"/> is showing 500 Internal Server Error always RRS feed

  • Question

  • User-1448265916 posted


    I have an api which is working fine, one of its call will return HttpStatusCode 401.

    When I add <httpErrors errorMode="Custom"/> line in web.config it always showing 500 Internal Server instead of 401.

    Am I missing any more settings?






    Wednesday, August 12, 2015 6:28 AM


  • User753101303 posted


    500 is a server side exception so check the Windows log to see the exact reason. If using just that my guess is that IIS could complain that you are switching to a custom page but without telling what is your default error handing page (but it's always best to just look at the exact error rather than trying to guess).

    Edit: see http://www.iis.net/configreference/system.webserver/httperrors and try to define defaultPath as well. If it still doesn't work, just look at the Windows error log.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 12, 2015 8:16 AM