심재운 블로그

728x90
반응형

ASP.NET MVC 에서 CUSTOM 에러 발생 처리 방안

 

 

<system.web>

<customErrors mode="On" defaultRedirect="/Html/ErrorPage/Error500.htm"></customErrors>

</system.web>

 

 

 

<system.webServer>
    <modules>
      <remove name="FormsAuthentication" />
      <remove name="WebDAVModule" />
    </modules>



    <httpErrors errorMode="Custom">
      <remove statusCode="401" subStatusCode="-1" />
      <remove statusCode="403" subStatusCode="-1" />
      <remove statusCode="404" subStatusCode="-1" />
      <remove statusCode="405" subStatusCode="-1" />
      <remove statusCode="500" subStatusCode="-1" />
      <remove statusCode="501" subStatusCode="-1" />
      <remove statusCode="502" subStatusCode="-1" />      
      <error statusCode="401" prefixLanguageFilePath="" path="/Html/ErrorPage/Error401.htm" responseMode="ExecuteURL" />
      <error statusCode="403" prefixLanguageFilePath="" path="/Html/ErrorPage/Error403.htm" responseMode="ExecuteURL" />
      <error statusCode="404" prefixLanguageFilePath="" path="/Html/ErrorPage/Error404.htm" responseMode="ExecuteURL" />
      <error statusCode="405" prefixLanguageFilePath="" path="/Html/ErrorPage/Error405.htm" responseMode="ExecuteURL" />
      <error statusCode="500" prefixLanguageFilePath="" path="/Html/ErrorPage/Error500.htm" responseMode="ExecuteURL" />
      <error statusCode="501" prefixLanguageFilePath="" path="/Html/ErrorPage/Error500.htm" responseMode="ExecuteURL" />
      <error statusCode="502" prefixLanguageFilePath="" path="/Html/ErrorPage/Error500.htm" responseMode="ExecuteURL" />
    </httpErrors>

<system.webServer>

 

 

https://stackoverflow.com/a/27204219

 

HTTP Error 404.0 - Not Found in MVC 5

My project in MVC 5.i wanted to handel 404. i did it but problem is that When I access the view using the following URL, everything works fine and as expected: http://localhost/Hotels/Index30701...

stackoverflow.com

 

728x90
반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band

본문과 관련 있는 내용으로 댓글을 남겨주시면 감사하겠습니다.

비밀글모드

loading