title: ASP.Net MVC routing legacy URLs passing querystring Ids to controller actions
body: <p>We're currently running on IIS6, but hoping to move to IIS 7 soon.</p>
  
  <p>We're moving an existing web forms site over to ASP.Net MVC.  We have quite a few legacy pages which we need to redirect to the new controllers.  I came across this article which looked interesting:
  <a href="http://blog.eworldui.net/post/2008/04/ASPNET-MVC---Legacy-Url-Routing.aspx" rel="nofollow noreferrer">http://blog.eworldui.net/post/2008/04/ASPNET-MVC---Legacy-Url-Routing.aspx</a></p>
  
  <p>So I guess I could either write my own route handler, or do my redirect in the controller.  The latter smells slightly.</p>
  
  <p>However, I'm not quite sure how to handle the query string values from the legacy urls which ideally I need to pass to my controller's Show() method.  For example:</p>
  
  <p><strong>Legacy URL:</strong></p>
  
  <blockquote>
    <p>/Artists/ViewArtist.aspx?Id=4589</p>
  </blockquote>
  
  <p><strong>I want this to map to:</strong></p>
  
  <blockquote>
    <p>ArtistsController Show action</p>
  </blockquote>
  
  <p>Actually my Show action takes the artist name, so I do want the user to be redirected from the Legacy URL to /artists/Madonna</p>
  
  <p>Thanks!</p>