Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ASP.NET 4.5MVC4アプリケーションがあります。xyz.com/*および不正な文字を含む悪意のあるURLをカスタムエラーページにリダイレクトしたい。これを行うための最良の方法は何ですか?
あなたの例のように彼らが無効なルートを入れた場合、カスタムエラーを次のように設定できます
<customErrors mode="RemoteOnly" defaultRedirect="~/error"> <error statusCode="404" redirect="~/error/Error404" /> <error statusCode="500" redirect="~/error" /> </customErrors>