在你的默认路由,你可以/应该对于初学者
routes.MapRoute("Catch All", "{*path}", new { controller = "Home", action = "ErrorPage" });
编辑2
的问题就出在部分redirectMode="ResponseRewrite"
没有这个补充这一点,它的工作原理。
使用路线虽然将解决这个问题,其中,所述路径不能被找到(404)
下一部分,像与坏的ID或其他数据存在的路径,1份可以是固定的与
<customErrors mode="On" defaultRedirect="/Home/ErrorPage" />
redirectMode="ResponseRewrite"
究竟做了什么?
编辑:它做了什么。
redirectMode
- ResponseRedirect:指定 URL直接浏览器必须 从原来的Web 请求URL不同。
- ResponseRewrite: 指定指向 浏览器的URL必须是原始Web 请求URL。
它只对.NET 3.5 SP1和.NET 4.0很重要。
编辑101:
对于redirectMode = “ResponseRewrite” 的ASP.NET调用使用Server.Execute(...)内,不与MVC路线的工作,所以对于MVC这只是一个工作静态HTML文件。
<customErrors mode="On" defaultRedirect="~/Views/Shared/error.htm" redirectMode="ResponseRewrite" />
的作品。
我对此很好奇。 – Rohrbs 2010-09-20 17:36:07
另请参阅http://stackoverflow.com/questions/3749083/oracle-padding-exploit-how-does-it-download-the-web-config – bzlm 2010-09-20 19:01:09
刚刚更新我的问题,因为斯科特在这里发布了一个常见问题 - http:// weblogs.asp.net/scottgu/archive/2010/09/20/frequently-asked-questions-about-the-asp-net-security-vulnerability.aspx。 – 2010-09-21 07:55:58