I am using URL Rewriting in Asp.net
framework 4.0 and I am replacing aspx with an html extension (i.e. 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")));
}
Changing the Application Pool from Classic to Integrated fixed the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With