ASP.Net 404 Redirect for friendly url not working
问题 I have the below code to do 404 redirect in Global.asax.cs protected void Application_Error(object sender, EventArgs e) { Exception ex = Server.GetLastError(); if (ex.InnerException != null) ex = ex.InnerException; if ((ex is HttpException && ((HttpException)ex).GetHttpCode()==404 )) { Response.Redirect("~/Custom404Page.aspx"); } } It works fine in visual studio and getting user friendly Custom404Page. But when I deploy the same in IIS 7.0, it is not at all working. Shows the below message In