닷넷관련/ASP.NET MVC 🍕
ASP.NET MVC 에서 CUSTOM 에러 발생 처리 방안
재우니
2020. 11. 27. 00:35
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