title: ASP.NET MVC: Making routes/URLs IIS6 and IIS7-friendly
body: <p>I have an ASP.NET MVC-application which I want deployable on both IIS6 and IIS7 and as we all know, IIS6 needs the ".mvc"-naming in the URL.</p>
  
  <p>Will this code work to make sure it works on all IIS-versions? Without having to make special adjustments in code, global.asax or config-files for the different IIS-versions.</p>
  
  <pre><code>bool usingIntegratedPipeline = HttpRuntime.UsingIntegratedPipeline;
  
  routes.MapRoute(
      "Default",
      usingIntegratedPipeline ?
          "{controller}/{action}/{id}" : "{controller}.mvc/{action}/{id}",
      new { controller = "Home", action = "Index", id = "" }
  );
  </code></pre>
  
  <p><strong>Update</strong>: Forgot to mention. No ISAPI. Hosted website, no control over the IIS-server.</p>