views:

400

answers:

1

I'm attempting to connect to my published website using the following url. http://www.mywebsite.com/ I keep getting: The incoming request does not match any route. Here are my routing rules:

routes.MapRoute(
                "Default",                                              // Route name
                "{controller}.aspx/{action}/{id}",                           // URL with parameters
                new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
            );

            routes.MapRoute(
                "Default2",                                              // Route name
                "/",                           // URL with parameters
                new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
            );

I'm using authentication as such:

<authentication mode="Forms" >
      <forms loginUrl="~/Home.aspx/Index"
        protection="All"
        timeout="300"/>
     </authentication>

When I'm not authenticated it goes to the correct page, but when I am authenticated it throws the above error. I'm using IIS 6.0 and doing the whole rewriting url workaround option.

What am I missing?

A: 

Change "/" in "Default2" route to "":

routes.MapRoute("Default2", "", new { ... });

Also make sure you have followed this guide: http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx for Default.aspx file if you are on IIS6.

Mehrdad Afshari