ASP-NET-4-URL-Routing-Default-Page
转自:http://blog.ysatech.com/post/2010/07/11/ASP-NET-4-URL-Routing-Default-Page.aspx
Problem
I was implementing ASP.NET routing features for one of the web application. The code was working correctly in the development environment. Then I deployed it to staging server, navigate to http://mydomain.com/ and received the error
"404 File Not Found".
I tried to include routes.MapPageRoute("Default", "/", "~/Default.aspx"); in the global.asax file but I received another error
"The route URL cannot start with a '/' or '~' character and it cannot contain a '?' character.Parameter name: routeUrl".
After several trials and errors, I found out that we should leave the "URL with parameters" empty. See below.
routes.MapPageRoute("Default", "", "~/Default.aspx");
I hope you all will find this information useful.