我已经设置了自定义 404 并且可以正常工作。但是当我尝试访问一些不存在的文件时,它显示了很好的 ASP.NET 404.0 错误页面。
我尝试添加<error statusCode="404.0" redirect="/notfound/?" />,但它不起作用,因为它statusCode应该是整数。
例子
http://localhost:123/das/dsagfdsa将重定向到http://localhost:123/notfound/?
http://localhost:123/das/dsagfdsa.png将保留并显示404.0错误。
自定义错误部分
<customErrors mode="On" redirectMode="ResponseRedirect" defaultRedirect="/notfound/?">
<error statusCode="404" redirect="/notfound/?" />
</customErrors>
问题
我如何确保它不仅会重定向到/notfound/错误的页面请求,还会重定向到错误的文件请求?
