[ACCEPTED]-ASP.NET MVC Routing - add .html extension to routes-asp.net-mvc-routing

Accepted answer
Score: 10

You have to force all request through the 3 ASP.NET pipeline, and you can do that by 2 adding only this single line to the web.config 1 of your application:

<system.webServer>
  <modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
Score: 9

You're guess that an IIS handler is probably 8 grabbing the request prior to MVC is likely 7 correct.

Assuming IIS 7: http://technet.microsoft.com/en-us/library/cc770990(v=ws.10).aspx

You need to edit 6 the .html handler in IIS to use ASP.NET.

You 5 can find it in the website properties under 4 the home directory tab in app configuration 3 in the mappings section in II6.

Something 2 along the lines of (version may be different): C:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll 1 is what you need to handle the .html files.

Score: 3

Changing the Application Pool from Classic 2 to Integrated fixed the issue. thank you 1 guyz for your help.

Score: 3

Just add this section to Web.config, and 5 all requests to the route/{*pathInfo} will 4 be handled by the specified handler, even 3 when there are dots in pathInfo. (taken 2 from ServiceStack MVC Host Web.config example 1 and this answer https://stackoverflow.com/a/12151501/801189)

  <location path="route">
    <system.web>
      <httpHandlers>
        <add path="*" type="System.Web.Handlers.TransferRequestHandler" verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" />
      </httpHandlers>
    </system.web>
    <!-- Required for IIS 7.0 -->
    <system.webServer>
      <modules runAllManagedModulesForAllRequests="true" />
      <validation validateIntegratedModeConfiguration="false" />
      <handlers>
        <add name="ApiURIs-ISAPI-Integrated-4.0" path="*" type="System.Web.Handlers.TransferRequestHandler" verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" preCondition="integratedMode,runtimeVersionv4.0" />
      </handlers>
    </system.webServer>
  </location>

More Related questions