locked
The page cannot be displayed because an internal server error has occurred. RRS feed

  • Question

  • User-1118601604 posted

    Hello.

    How I get displayed custum error when i have in my script any sintax problem?

    Now i get : The page cannot be displayed because an internal server error has occurred.

    web.config

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <httpErrors errorMode="DetailedLocalOnly" />
        </system.webServer>
    </configuration>

    Sunday, May 13, 2012 8:32 AM

Answers

  • User1932589091 posted
    Hello,

    Use the following snippet within <system.web> tags

    <customErrors mode="RemoteOnly" defaultRedirect="~/Errors/500.htm">
    <error statusCode="404" redirect="~/Errors/404.htm"/>
    </customErrors>

    Point to the correct custom error pages by replacing 404.htm and 500.htm in my example. If you do not wish to have separate custom error page depending on the error code, you can just use the following tags.

    <customErrors mode="RemoteOnly" defaultRedirect="~/Errors/500.htm">
    </customErrors>
    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, May 14, 2012 7:15 AM
  • User1773224436 posted

    Hi,

    How I get displayed custum error when i have in my script any sintax problem?

    When a request made to IIS encouters an error, there are two sort of error may be displayed in the browser: custom error and detailed error. Generally, custom errors are error pages that the client user of your web site to see. Detailed errors are intended for IIS administrator or developers.

    Check this article about how to use http detailed error in IIS:

    http://learn.iis.net/page.aspx/267/how-to-use-http-detailed-errors-in-iis/

    Please pay close attention to the table of errorMode.

    And this blog elabrate how to enable custom error page:

    http://blogs.iis.net/rakkimk/archive/2008/10/03/iis7-enabling-custom-error-pages.aspx

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, May 18, 2012 6:35 AM

All replies

  • User1932589091 posted
    Hello,

    Use the following snippet within <system.web> tags

    <customErrors mode="RemoteOnly" defaultRedirect="~/Errors/500.htm">
    <error statusCode="404" redirect="~/Errors/404.htm"/>
    </customErrors>

    Point to the correct custom error pages by replacing 404.htm and 500.htm in my example. If you do not wish to have separate custom error page depending on the error code, you can just use the following tags.

    <customErrors mode="RemoteOnly" defaultRedirect="~/Errors/500.htm">
    </customErrors>
    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, May 14, 2012 7:15 AM
  • User390598869 posted

    Hi

    To see more clear what the error is you need to include <customErrors mode="off">

    Once you have corrected the syntax you can delete this entry or put it to ON.

    Wednesday, May 16, 2012 5:23 AM
  • User1773224436 posted

    Hi,

    How I get displayed custum error when i have in my script any sintax problem?

    When a request made to IIS encouters an error, there are two sort of error may be displayed in the browser: custom error and detailed error. Generally, custom errors are error pages that the client user of your web site to see. Detailed errors are intended for IIS administrator or developers.

    Check this article about how to use http detailed error in IIS:

    http://learn.iis.net/page.aspx/267/how-to-use-http-detailed-errors-in-iis/

    Please pay close attention to the table of errorMode.

    And this blog elabrate how to enable custom error page:

    http://blogs.iis.net/rakkimk/archive/2008/10/03/iis7-enabling-custom-error-pages.aspx

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, May 18, 2012 6:35 AM
  • User-1118601604 posted

    Thank you.

    Friday, May 18, 2012 2:05 PM
  • User-1513287113 posted

    To see more clear what the error is you need to include <customErrors mode="off">

    What you meant was <customErrors mode="Off" />

    Wednesday, April 3, 2013 6:53 AM
  • User390598869 posted

    Really? This is your (after 11 months) contribution?

    Wednesday, April 3, 2013 1:13 PM
  • User540612753 posted

    The best way is to check for application events log in your system. In my case I kept on getting the internal server issue even after setting the customerror but ultimately I came to know through the event log that there was a compilation error.

    Wednesday, June 19, 2013 5:35 AM