Web アプリをカスタム 404 ページにリダイレクトしようとしています。「.aspx」拡張子が付いている場合を除き、すべての URL で機能します。
サーバーは Windows Server 2008 で、web.config には次の設定があります (簡単な例として google.com を使用)。
<customErrors defaultRedirect="http://www.google.com" mode="On" redirectMode="ResponseRedirect"></customErrors>
<httpErrors errorMode="Custom">
<clear />
<remove statusCode="500" subStatusCode="-1" />
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/404-Page/" responseMode="ExecuteURL" />
<error statusCode="500" prefixLanguageFilePath="" path="/404-Page/" responseMode="ExecuteURL" />
</httpErrors>
繰り返しますが、HTTP エラーは、「.aspx」の拡張子以外のすべてに対して機能します。