404.0 Error when routing .html from .aspx in IIS 8.0

I am using URL Rewriting in Asp.net framework 4.0 and I am replacing aspx with an html extension (ie I am using routing like Login.aspx as Login.html). But it is showing error a 404 (not found) error. In short, URL Rewriting with .html extension is not working on IIS 8.0. Without .html (like Login.aspx with login), it is working fine.

Check this :

  • theprojectjugaad.com/Login.html (404.0 error)

  • theprojectjugaad.com/Register (Working fine)

  • Please help me to solve this.

    Global.asax

    void Application_Start(object sender, EventArgs e)
    {
            RegisterRoutes();
    }
    
    private static void RegisterRoutes()
    {
            System.Web.Routing.RouteTable.Routes.Add(
                    "Login", new System.Web.Routing.Route("Login.html",
                                        new DisplayRouteHandler("~/Login.aspx")));
    }
    

    将应用程序池从Classic更改为Integrated可以解决问题。

    链接地址: http://www.djcxy.com/p/30790.html

    上一篇: 在Go openpgp中验证gpg签名

    下一篇: 404.0在IIS 8.0中从.aspx路由.html时出错