Putting Down Routes

Boost Your Site’s SEO Friendliness using ASP.NET 4.0

The Dark Art of Search Engine Optimization involves a number of mysterious rituals and incantations used to divine the favor of major search engine crawler robots to your particular corner of the Web. If your site happens to make liberal use of query string arguments in its URLs, however, it could introduce some snags and snares for these benevolent bots to stumble upon that will cause them to turn tail on perhaps some of the more important portions of your online presence. Non-ACSII characters, spaces, and other misfits of the URI that your browser will put up with can all be problematic for your SEO profile. The common fix is to streamline your URLs using routing.

For those of you using ASP.NET MVC, you can rest easy knowing that you already have this capability baked in to your site, and you can go about living your awesome exciting lives on the bleeding edge and fly home in your jetpack. Many of us, however, are still wrangling ye old-fashioned ASP.NET Web Forms, only daring to dream of rocking sleek and modern SEO-friendly URLs.

Gu to the Rescue

In the eighth of a series of posts on the forthcoming ASP.NET 4.0, our hero at Microsoft Scott Guthrie breaks down for us how SEO-cooperative URL-ing works, and also how we can easily retrofit this technique to our dusty old Web Forms apps that aren’t so hot at gussying themselves up for the bots:

For example, the URL for a traditional page that displays product categories might look like below:

http://www.mysite.com/products.aspx?category=software

Using the URL routing engine in ASP.NET 4 you can now configure the application to accept the following URL instead to render the same information:

http://www.mysite.com/products/software

With ASP.NET 4.0, URLs like above can now be mapped to both ASP.NET MVC Controller classes, as well as ASP.NET Web Forms based pages.

Guthrie goes on to provide an example of how this is done:

step2

This is a great example of low-hanging fruit available upon upgrading to Visual Studio 2010/ASP.NET 4.0 that can provide a real-world boost to your existing web applications, without the unseemly chicken sacrifice. Also, it’s shiny.

URL Routing with ASP.NET 4 Web Forms (VS 2010 and .NET 4.0 Series) [ScottGu’s Blog]

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s