If you’re using ASP.NET Routing (without the MVC abstractions), you’ll be trying to route http://www.mysite.com/Default.aspx sooner or later. This won’t work: public static void RegisterRoutes(RouteCollection routes)
{
routes.Add("Default", new Route("Default.aspx", new RouteHandler("~/Site/Default.aspx")));
}
It won’t work because the request isn’t actually for Default.aspx, the request is for the site root, which IIS will catch. IIS responds by attempting to serve the default page for the site (probably Default.aspx), which may or may not exist.
To route requests to the site root, you’ll need to do this instead:
public static void RegisterRoutes(RouteCollection routes)
{
routes.Add("Default", new Route(string.Empty, new RouteHandler("~/Site/Default.aspx")));
}
We’re...