views:

216

answers:

4

From what I understand MVC has more SEO friendly urls. Or at least it is easier to achieve.

Is the reason for this that you can make fake folders that are actually arguments like:

question/37/WhatIsSEO

Where the equivilent Webforms would be question.aspx?id=37&title=WhatIsSEO

Where the title doesn't actually do anything, it is just there for SEO...

Does it rank what looks like folders higher than arguments? Is that why it is superior or am I completely off base?

If I am not, what is the best solution to combat this as a webforms developer?

+1  A: 

I have a blog post about exactly that here:

http://tech-nous.blogspot.com/2009/07/simple-url-rewriting-with-aspnet-and.html

IainMH
Very cool. Thanks
Blankasaurus
Welcome. :-) It should be noted that as @Nissan Fan mentions, there are now some native MS ways of doing this that came out just after I wrote that post.
IainMH
So this won't work with IIS?
Blankasaurus
Your comment showed up after I posted mine =P
Blankasaurus
Yes it will work fine with IIS. That's what I was using.
IainMH
+2  A: 

The same routing used by ASP.NET MVC can be used in ASP.NET Web Forms if you are using .NET 3.5 SP1 (or 4.0) and IIS 7:

http://msdn.microsoft.com/en-us/magazine/dd347546.aspx http://haacked.com/archive/2008/03/11/using-routing-with-webforms.aspx

Nissan Fan
Awesome. Will try to implement today. Completely negates any reason I would have for MVC =D
Blankasaurus
+1  A: 
  • Shorter Urls simply just look better.
  • Users are more likely to remember the Url and link to your site giving you better Page Rank.
  • Yes, WebForms developers can and should take advantage of the Routing.
  • These Urls are perceived to rank higher than querystring based Urls, but who knows for sure. This Google blog article suggests sometimes querystings are better than static looking Urls.
  • Below is a small snippet of code in your global.asax file to make it work. The entire solution is more involved but very doable.

    routes.Add("qId", new Route("question/{id}", new CustomRouteHandler ("~/Question.aspx")));

James Lawruk
+1  A: 

Easiest way is to add a http module to your current webforms project.

http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

This shows you the basics of it, But it can easily be expanded so that the pages you want to rewite is taken from a database or even built on the fly.

TheAlbear