【发布时间】: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 下本地工作
【问题讨论】: