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?
http://www.hanselman.com/blog/IntroducingASPNETFriendlyUrlsCleanerURLsEasierRoutingAndMobileViewsForASPNETWebForms.aspx
For More :
http://www.codeproject.com/Articles/2538/URL-Rewriting-with-ASP-NET
http://www.codeproject.com/Articles/27448/Writing-SEO-friendly-url-using-HttpHandlers-in-ASP
http://magwebonline.blogspot.com/2012/12/seo-friendly-url-in-aspnet.html
Comments
Post a Comment