title: Making MVC handle urls containing dots (.page)
body: <p>For legacy <a href="https://stackoverflow.com/questions/57712/asp-net-mvc-and-iis-5">reasons</a> we have urls with '.page' in them like so:</p>
  
  <blockquote>
    <p>/controller.page/action</p>
  </blockquote>
  
  <p>We have re-rewritten the app, and so the urls are no longer in this format and we need to 301 redirect them, which needs to happen in code. The new app is a MVC 3 &amp; .net 4 and is IIS 7 hosted.</p>
  
  <p>The issue is, IIS is seeing the .page in the url, then looking for a handler for this extension not finding it, and then returning a 404.0 and not handing the request off too .net where we can then preform the redirect.</p>
  
  <p>Any idea on how to resolve this?</p>
  
  <p>I tried adding this handler in the web.config:</p>
  
  <pre><code>&lt;add name="LegacyMVC" path="*.page" verb="*"
      type="System.Web.Mvc.MvcHttpHandler" preCondition="integratedMode" /&gt;
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>System.NotSupportedException: Specified method is not supported.
     at System.Web.Routing.StopRoutingHandler.GetHttpHandler(RequestContext requestContext)
     at System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContextBase httpContext)
     at System.Web.Mvc.MvcHttpHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)
  </code></pre>