Iis 7 IIS 7.5和处理程序映射

Iis 7 IIS 7.5和处理程序映射,iis-7,routes,handler,Iis 7,Routes,Handler,我想将所有类似的URL重定向到我的ASP.NET MVC应用程序。我为我的站点打开了处理程序映射,并添加了以下规则: 在web.config中,它看起来像: <system.webServer> <handlers> <add name="HTML Rewriter" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsof

我想将所有类似的URL重定向到我的ASP.NET MVC应用程序。我为我的站点打开了处理程序映射,并添加了以下规则:

在web.config中,它看起来像:

  <system.webServer>
    <handlers>
            <add name="HTML Rewriter" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
    </handlers>
</system.webServer>

但是当我试图打开这个url时,我发现404文件没有找到。为什么?它在IIS express下本地工作

添加处理程序后,您必须执行它

转到编辑功能设置…选择执行选项

并将此处理程序添加到服务器级别的ISAPI和CGI限制中。它将解决此问题

    routes.MapRoute(
        "xxx", // Route name
        "{ext}/{filename}.html", // URL with parameters
        new { controller = "Mycontr", action = "Index" } // Parameter defaults
    );