URL routing not working on production server IIS 7 +

Posted by Jpchoudhari under ASP.NET on 9/24/2012 | Points: 10 | Views : 5475 | Status : [Member] | Replies : 2
Hi,
I have a asp.net website with url routing (not mvc). Routing works perfectly on local but its not working on live server. What could be the problem. I have done following things.

I have route all my pages like
System.Web.Routing.RouteTable.Routes.MapPageRoute("HomePage", "home.html", "~/home.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("ServicePage", "services.html", "~/services.aspx");

I tried using runAllManagedModulesForAllRequests="true" in web.config but its not working. It is giving

404 - File or directory not found. error.

Kind Regards,
Jay



Responses

Posted by: Navadeebans on: 9/24/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

What you done is correct, but you need add another attribute like this, then you ll get the routing on IIS

<modules runAllManagedModulesForAllRequests="true">
<remove name="UrlRoutingModule"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>

Thanks
Nava Deeban S.

Jpchoudhari, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jpchoudhari on: 9/24/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

I tried what you have suggested; by the time searching i found that we need to add application mapping in IIS mgr for .html files. I did it in IIS 5 and now I am trying to figure it out how to do same thing in IIS 7.


Kind Regards,
Jay

Jpchoudhari, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response