HttpModule URL rewriting using IIS6 with no extensionless URLs

ε祈祈猫儿з 提交于 2019-12-05 21:34:54

So it turns out what was happening was the following:

I guess this could prove to be a useful kludge for someone, but we're moving to an isapi filter. One heads-up is that this will by default lead to a tight loop of redirects!

If you run a site using the Visual Studio development web server all requests will be handled by asp.net so your HttpModule will run.

On IIS6 this should not happen unless it is set up to forward the requests to asp.net.

Are you sure that when "it works" you aren't running under the Cassini development web server included in VS.NET ? Because extensionless wildcards do work under Cassini, which can be very confusing to say the least.

If you are using an IIS6 with ASP.net 4.0, you must specify and register the modules like this:

<system.web>
<httpModules>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>

not

<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
</modules>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!