View Complete Thread
  • Re: Custom error page configuration on IIS 8

    Oct 23, 2018 05:35 AM|Brando Zhang|LINK

    Hi madhura.torsekar,

    If you host an application, I suggest you could directly use C# codes to throw 403 exception.

    Codes as below:

      throw new HttpException(403, "This is a '403' test");

    But ASP.Net application will not go to IIS error page, it will go to web custom error page.

    I suggest you could add below web.config setting in system.web tag.

        <customErrors  mode="On">
          <error statusCode="403" redirect="/default.aspx" />

    Besides, if you want to test the IIS custom error page, I suggest you could try to enable the SSL required setting.

    If you still use http to access the site, you will receive 403 forbidden error.

    Best Regards,