2014-02-17 112 views
2

使用HiddenSegments IIS7是防止像/ bin和/ app_data文件友好的HiddenSegments

在該網站顯示空白頁面的那一刻文件夾瀏覽404錯誤頁面,是有可能的路線這對我標準的404頁?

回答

1

當然可以。這裏是我經常使用的web.config文件:

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <httpErrors> 
      <remove statusCode="403" subStatusCode="-1" /> 
      <remove statusCode="500" subStatusCode="-1" /> 
      <remove statusCode="404" subStatusCode="-1" /> 
      <error statusCode="404" subStatusCode="-1" 
prefixLanguageFilePath="" path="/errordocs/404.htm" responseMode="ExecuteURL" /> 
      <error statusCode="500" subStatusCode="-1" 
prefixLanguageFilePath="" path="/errordocs/500.htm" responseMode="ExecuteURL" /> 
      <error statusCode="403" subStatusCode="-1" 
prefixLanguageFilePath="" path="/errordocs/403.htm" responseMode="ExecuteURL" /> 
     </httpErrors> 
    </system.webServer> 
</configuration> 
+0

完美,謝謝! –