Last active
November 10, 2015 00:35
-
-
Save bestpika/9fb6cf4c393d818cd9c0 to your computer and use it in GitHub Desktop.
Web.config 指定 httpErrors 行為
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<system.web> | |
<customErrors mode="On"> | |
<!-- 先移除 --> | |
<remove statusCode="401" subStatusCode="-1" /> | |
<remove statusCode="403" subStatusCode="-1" /> | |
<remove statusCode="404" subStatusCode="-1" /> | |
<!-- 再增加 --> | |
<error statusCode="401" path="https://google.com" responseMode="Redirect" /> | |
<error statusCode="403" path="/403.html" responseMode="ExecuteURL" /> | |
<error statusCode="404" path="/404.html" responseMode="ExecuteURL" /> | |
</customErrors> | |
</system.web> | |
<system.webServer> | |
<httpErrors> | |
<!-- 先移除 --> | |
<remove statusCode="401" subStatusCode="-1" /> | |
<remove statusCode="403" subStatusCode="-1" /> | |
<remove statusCode="404" subStatusCode="-1" /> | |
<!-- 再增加 --> | |
<error statusCode="401" path="https://google.com" responseMode="Redirect" /> | |
<error statusCode="403" path="/403.html" responseMode="ExecuteURL" /> | |
<error statusCode="404" path="/404.html" responseMode="ExecuteURL" /> | |
</httpErrors> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment