Error message on page
网站报404错误
下面是漏洞扫描报告
解决方法:
1.web.config里面的system.web添加
<!--404错误-->
<customErrors mode="On" defaultRedirect="~/Error/Error404">
<error statusCode="404" redirect="~/Error/Error404" />
</customErrors>
</system.web>
2.ErrorController.cs
public ActionResult Error404()
{
return View();
}
3.在view/Error/Error404.cshtml
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>Error404</title>
</head>
<body>
<div style=" margin:0 auto; margin-left:100px;"><img src="/Content/Images/404.jpg" /></div>
</body>
</html>