【问题标题】:IIS 7.5 and handler mappingIIS 7.5 和处理程序映射
【发布时间】:2013-07-10 12:50:54
【问题描述】:

我想将http://domain.com/xxx/yyyyy.html 之类的所有网址重定向到我的 ASP.NET MVC 应用程序。我为我的站点打开了 Handler Mappings 并添加了以下规则:

在 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>

在asp.net mvc应用的路由中:

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

但是当我尝试打开这个 url 时,我得到了 404 文件未找到。为什么?它在 IIS express 下本地工作

【问题讨论】:

    标签: iis-7 routes handler


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2011-04-11
      • 2012-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-16
      • 1970-01-01
      • 2016-08-07
      • 2014-10-23
      相关资源
      最近更新 更多