문제

이 페이지는 무엇입니까? 구성 파일에 항목이 있습니다.

  <customErrors mode="off" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>

genericerrorpage.htm의 아래 오류입니다

Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error 
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>
도움이 되었습니까?

해결책

파일 'genericerrorpage.htm', 'noaccess.htm'및 'filenotfound.htm'은 웹 응용 프로그램을 만들 때 Visual Studio에서 작성한 기본 파일 이름입니다. HTML 파일 또는 ASPX 페이지를 사용하여 해당 이름을 web.config에서 사용할 수 있습니다. 이 이름은 단지 더미 값입니다.

다른 팁

기본적으로 사용자가 403 또는 404 이외의 오류를 얻는 경우 (예외가있는 경우 500 이외의 다른 것 외에는 주목할 만하면) 해당 페이지로 리디렉션됩니다. 통합 파이프 라인 또는 IIS6 와일드 카드가 매핑되면 FilenotFound.htm으로 튀어 나옵니다. 그렇지 않으면 표준 404 만 볼 수 있습니다).

적어도 사용자에게 "오 아니오! 뭔가 잘못되었습니다!" 페이지.

오류가 발생하고 상태 코드가 403 또는 404에 다르면 GenericErrorPage.htm

또한 선언에 오류가 있습니다. 그만큼 mode 속성이 있어야합니다 Off 대신에 off:

<customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
    <error statusCode="403" redirect="NoAccess.htm" />
    <error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top