I've been reading a lot about the SEO friendly URL features in ASP.Net. Most of what I've read involves taking a URL that uses query-string params and making it pretty. I'm interested in making standard URL's pretty. For example:
http://mysite.com/aboutus.aspx
should be...
http://mysite.com/about-us
I've found that the code below satisfies the requirement:
void Application_Start(object sender, EventArgs e)
{
// Enable routing
RegisterRoutes(RouteTable.Routes);
}
void RegisterRoutes(RouteCollection routes)
{
// About us section routes
routes.MapPageRoute(
"AboutUsRoute",
"{about-us}",
"~/aboutus.aspx"
);
}
My issue is that I'll have to manually specify a route for each page in the site. Is there a better way to do this?