Can Intelligencia.UrlRewriter be made to work in IIS7?

后端 未结 4 2104
刺人心
刺人心 2020-12-25 15:16

We\'ve inherited an application that uses the Intelligencia.UrlRewriter module. Our environment though is IIS7. We\'ve already set our site to run in the classic asp.net app

相关标签:
4条回答
  • 2020-12-25 15:54

    You need to define the config on the system.webServer element, like:

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

    You can keep both config. What you probably have now is:

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

    Check the section "Migrating ASP.NET Applications to IIS 7.0 Integrated mod" on http://learn.iis.net/page.aspx/243/aspnet-integration-with-iis7/

    ps. I have been using it with no trouble at all, as long as that config is in.

    Update 1: Also check http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx, particularly "Approach 3: Using an HttpModule to Perform Extension-Less URL Rewriting with IIS7", since the config I added has the extension-less config.

    0 讨论(0)
  • 2020-12-25 15:55

    I have spotted the same problem, after few tries I found out that changing asp mode to integrated pipeline helped.

    0 讨论(0)
  • 2020-12-25 15:56

    Yes I had the exact same problem with Intelligencia.UrlRewriter module, running under Win Vista & IIS7, however switching to the classic asp.net app pool did fix the problem. Are you running the app in a new virtual directory? That can sometimes mess with the root path to the application which could make a difference to the rules in the web.config

    0 讨论(0)
  • 2020-12-25 16:01

    Don't forget to add the following lines in the system.webServer section of your web.config file if you are using IIS7

    <system.webServer>
    <modules runAllManagedModulesForAllRequests=”true”>
    <add name=”UrlRewriter” type=”Intelligencia.UrlRewriter.RewriterHttpModule” />
    </modules>
    <validation validateIntegratedModeConfiguration=”false” />
    </system.webServer>
    

    As in

    http://frozengraphics.wordpress.com/2009/12/06/intelligencia-urlrewriter-and-iis7/

    0 讨论(0)
提交回复
热议问题