ASP.NET MVC, What about SEO?
I’ve started working the the latest preview of the ASP.NET MVC framework. I’m completely converting one of my sites, because learning by doing is typically the best way. Unfortunately, I’ve run into some alarming SEO (Search Engine Optimization) issues with this new paradigm (or more specifically, the Microsoft implementation).
Duplicate Content
Duplicate content is a major issue. If a search engine (Google, which we’re primarily concerned with) finds multiple identical pages, it could be seen as a spam technique. Google likes original content, and penalizes duplicate content.
The problem is that the ASP.NET MVC default routing is too forgiving. If I have a page with this address: "/controller/action/id", the routing engine happily serves it up at "/controller/action/id/". There is no reason to not be strict on this. In ASP.NET WebForms, if you forget the trailing slash, it will automatically perform a 301 (permanent) redirect to the version with the trailing slash.
ASP.NET MVC has a bug (I’m calling it that) that won’t let you define a URL as requiring a trailing slash. Below, I’ve defined a route as a sample. In the URL to match, I have a trailing slash. In the routing code, the trailing slash is removed when it’s added to the routing table. This also has the side-effect of generating the URL’s without a trailing slash.
routes.MapRoute(
"Legacy-Firefox",
"Firefox-Extension/",
new { controller = "Home", action = "Firefox", id = "" } );
Since routes can be configured to reuse actions and controllers, it makes more paths to follow. If I again use the route defined above, I end up with all of these valid addresses that could potentially be linked to and indexed:
- a.com/Firefox-Extension
- a.com/Firefox-Extension/
- a.com/Home/Firefox
- a.com/Home/Firefox/
- a.com/Home/Firefox/anythingyouwant
If you’re lucky, Google won’t penalize duplicate content. However, if Google indexes the same content using multiple URL’s, you won’t get the benefit of focusing the PageRank. A similar situation occurs with you have a site that can be addressed like "cnn.com" and "www.cnn.com". They counted as separate pages, that end up competing for good rank.
Legacy URL’s
I’m sure there is a large group of people that are anxiously awaiting to take advantage of the new MVC style development. Many of them will undoubtedly have existing URL’s they want to preserve.
There are a couple of ways to handle this issue. The search engines would prefer that your URL’s simply remain the same. This is possible, but requires some fancy routing. The SEO community highly recommends this approach (with good cause).
Another way to handle it is to adopt the new REST style URL’s that typically make the most sense with an MVC approach: "/controller/action/id". Then, setup 301 redirects from the old addresses to the new one’s. This article discusses the technical details. In theory, this should be the best scenario. However, Google themselves say to get the incoming links pointed to the new addresses ASAP. The truth is, this solution sucks. I’ve actually done this with a site. It was search engine suicide for a couple of months. I eventually got my old position back, but lost a significant amount of revenue because of it.
Yet another way that I found is to set up multiple routes so that the content is accessible with both the old and new addresses. If you’ve been paying attention, you’ll know that this counts as duplicate content, and is very, very bad. I was in shock when I found this approach being advocated.
Conclusion
I’m not saying the routing system is completely wrong, I just think it would be set up so that the easy way of migrating a site is the correct way, or as close to it as possible. I don’t want to have to write custom routing. At the very least, come up with a way to designate that a particular action has a single path (and cancel out additional paths in other routes). It would also be nice if there was a way to use the old style urlMapping section in the web.config for legacy URL’s.
If I’m completely wrong about how the routing works, let me know. It’s difficult to find good information (which is understandable right now), and I’m admittedly still in an early learning stage.

Removing duplicate page addresses in MVC said,
Wrote on October 7, 2008 @ 10:13 am
[...] couple of SEO issues with MVC. I’ll discuss two ways to get around the trailing slash issue. Recall what the issue was. MVC will happily serve up your URL’s both with and without a trailing [...]
Scott Hanselman's Computer Zen - ASP.NET MVC and the new IIS7 Rewrite Module said,
Wrote on October 10, 2008 @ 4:23 am
[...] noticed a post by Jason Young recently on ASP.NET and SEO (Search Engine Optimization). He’s concerned about trailing [...]
Derik Whittaker said,
Wrote on October 10, 2008 @ 9:05 am
So you say that using Routing to resolve multiple URL’s into a single page is very, very bad because it created duplicate content (not arguing that here).
However you fail to provide a better way. Both options you mention have pros/cons and I would rather have duplicate routes than loose engine traffic.
superjason said,
Wrote on October 10, 2008 @ 10:35 am
There are 2 important ideas here.
Concept 1: Age matters to Google. Pages that have been around longer tend to rank better. In general, you should try to never change your URL’s. I mentioned that I’ve specifically seen situations where this hurt a site for a couple of months.
Concept 2: Pages should have a single URL as to not show up as duplicate content, and to get links all pointing to the same place.
In an ideal world, you would never change your URL’s, and alternative versions of the page would do a 301 (permanent) redirect to the preferred version.
So, the solution is to generate consistent URL’s when you link to your own pages, and have a good way of correctly redirecting URL’s that are simply an alternative way of looking at the same page.
Obviously you’ll have to weight the cost of doing this with the search engine benefit.
ASP.NET MVC Pro’s and Con’s said,
Wrote on October 20, 2008 @ 8:53 am
[...] mentioned some of the SEO issues before, and all but the trailing slash issue have a reasonable workaround. The routing engine likes [...]