4

Web アプリで 403 および 404 エラーを処理しようとしています。MS の指示を読み、サーバーに適用しました。IIS7 マネージャーは、web.config を次のように編集することで、これを効果的に処理します。

<httpRedirect enabled="false" destination="/MySite" httpResponseStatus="Temporary" />
   <httpErrors>
      <remove statusCode="404" subStatusCode="-1" />
      <remove statusCode="403" subStatusCode="-1" />
      <error statusCode="403" prefixLanguageFilePath="" path="/mySite/Error.aspx" responseMode="ExecuteURL" />
       <error statusCode="404" prefixLanguageFilePath="" path="/mySite/Error.aspx" responseMode="ExecuteURL" />
   </httpErrors>

http://www.mysite/fictiousURL.aspxのようなリクエストは処理しますが、 http: //www.mysite/fictiousURLTest.htmlでは機能しません。aspx リクエストしか処理できないようです。

system.web ノードにこの構成を追加して、http://www.15seconds.com/issue/030102.htmも試しました。<customErrors mode="On" defaultRedirect="/mysite/error.aspx" />

誰でも知っている a) IIS7 が aspx のみを処理する理由と b) http://www.mysite/fictiousURLTest.htmlのようなユニバーサル リクエストを処理する方法を知っている人はいますか?

ありがとう、ビルN

4

1 に答える 1

2

ここで与えられた私の応答を参照してください: IIS7 と HTTP ステータス コードの処理

設定する必要があるようです

  <system.webServer>
    <httpErrors existingResponse="PassThrough" />
  </system.webServer>
于 2011-05-16T20:53:05.883 に答える