2013-07-10 66 views
0

我想重定向所有的URL像http://domain.com/xxx/yyyyy.html到我的ASP.NET MVC應用程序。我打開處理程序映射爲我的網站,並添加以下規則:IIS 7.5和處理程序映射

enter image description here

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

但是當我嘗試打開這個網址時我沒有找到404文件。爲什麼?它的工作原理本地IIS表達

回答

0

下添加處理程序後,您必須執行它...

轉到編輯功能設置...選擇執行選項...

而且這個處理程序添加到ISAPI &服務器級別的CGI限制..它將解決問題