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 application pool (which aparantly works for a lot of these kinds of problems). However we're still not seeing the URLs in our app be rewritten.
我们继承了一个使用Intelligencia.UrlRewriter模块的应用程序。我们的环境虽然是IIS7。我们已经将我们的网站设置为在经典的asp.net应用程序池中运行(它可以解决很多这类问题)。但是,我们仍然没有看到我们应用中的网址被重写。
Has anyone run into this?
有没有人碰到这个?
4 个解决方案
#1
You need to define the config on the system.webServer element, like:
您需要在system.webServer元素上定义配置,例如:
<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/
请查看http://learn.iis.net/page.aspx/243/aspnet-integration-with-iis7/上的“将ASP.NET应用程序迁移到IIS 7.0集成mod”部分
ps. I have been using it with no trouble at all, as long as that config is in.
PS。我一直在使用它,没有任何问题,只要该配置在。
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.
更新1:还要查看http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx,特别是“方法3:使用HttpModule来使用IIS7执行无扩展URL重写“,因为我添加的配置具有无扩展配置。
#2
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
是的,我在Intelligen和Red7下运行的Intelligencia.UrlRewriter模块存在完全相同的问题,但是切换到经典的asp.net应用程序池确实解决了这个问题。您是否在新的虚拟目录中运行应用程序?这有时会破坏应用程序的根路径,这可能会对web.config中的规则产生影响
#3
I have spotted the same problem, after few tries I found out that changing asp mode to integrated pipeline helped.
我发现了同样的问题,经过几次尝试后我发现将asp模式改为集成管道有所帮助。
#4
Don't forget to add the following lines in the system.webServer section of your web.config file if you are using IIS7
如果您使用的是IIS7,请不要忘记在web.config文件的system.webServer部分添加以下行
<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/
#1
You need to define the config on the system.webServer element, like:
您需要在system.webServer元素上定义配置,例如:
<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/
请查看http://learn.iis.net/page.aspx/243/aspnet-integration-with-iis7/上的“将ASP.NET应用程序迁移到IIS 7.0集成mod”部分
ps. I have been using it with no trouble at all, as long as that config is in.
PS。我一直在使用它,没有任何问题,只要该配置在。
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.
更新1:还要查看http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx,特别是“方法3:使用HttpModule来使用IIS7执行无扩展URL重写“,因为我添加的配置具有无扩展配置。
#2
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
是的,我在Intelligen和Red7下运行的Intelligencia.UrlRewriter模块存在完全相同的问题,但是切换到经典的asp.net应用程序池确实解决了这个问题。您是否在新的虚拟目录中运行应用程序?这有时会破坏应用程序的根路径,这可能会对web.config中的规则产生影响
#3
I have spotted the same problem, after few tries I found out that changing asp mode to integrated pipeline helped.
我发现了同样的问题,经过几次尝试后我发现将asp模式改为集成管道有所帮助。
#4
Don't forget to add the following lines in the system.webServer section of your web.config file if you are using IIS7
如果您使用的是IIS7,请不要忘记在web.config文件的system.webServer部分添加以下行
<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/