MVC Routes and SEO


I’ve been looking at Micrsofts MVC engine lately and I can’t help but think why isn’t the default route more SEO friendly.

When I create a new project this code is placed inside of my global.asax.cs file.

public static void RegisterRoutes(RouteCollection routes)
 {
 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

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

 }

That will give me a product url like this :

www.somewebsite.com/products/view/1.aspx

But I’d rather have a friendly name in there somewhere like this :

www.somewebsite.com/products/view/my-friendly-product-name/1.aspx

So I think if you go with defualt routing you’re making a mistake.

Advertisements

About Kevin Buckley
.Net web developer with a lot of experience in CMS. Currently working at Sitecore as Solutions Engineer.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: