简体   繁体   English

Intelligencia UrlRewriter.NET在IIS 6上无法正常工作?

[英]Intelligencia UrlRewriter.NET not working properly on IIS 6?

I'm having an issue getting the following syntax to work: 我在使用以下语法时遇到问题:

<rewriter>
    <!-- This does NOTHING -->
    <if url="whywontthiswork\.aspx" rewrite="/default.aspx" />

    <!-- This redirects correctly -->
    <redirect url="whywontthiswork\.aspx" to="/default.aspx" />
</rewriter>

As noted, the first rule does nothing no matter what I try. 如前所述,无论我如何尝试,第一条规则都无济于事。 The X-Powered-By field on the response for that page request always says "ASP.NET". 该页面请求的响应上的X-Powered-By字段始终显示为“ ASP.NET”。 However, the second rewrite rule always works, and the X-Powered-By field on the response for that request is "ASP.NET,UrlRewriter.NET 2.0". 但是,第二个重写规则始终有效,并且该请求的响应上的X-Powered-By字段为“ ASP.NET,UrlRewriter.NET 2.0”。

I believe that IIS is configured properly because it is handling the request correctly for <redirect /> . 我认为IIS配置正确,因为它可以正确处理<redirect />的请求。 The issue is that I don't have any ideas why the first rewrite rule would not execute. 问题是我不知道为什么第一个重写规则不会执行。

I have tried to search the documentation on UrlRewriter.NET , but at this time, it seems their site if offline or no longer in service. 我试图在UrlRewriter.NET上搜索文档,但目前看来,它们的站点是否处于脱机状态或不再可用。 Any ideas? 有任何想法吗?

OK, sorry to answer my own question but I figured out the solution shortly after posting this. 好的,很抱歉回答我自己的问题,但发布此消息后不久,我便找到了解决方案。 I most likely have a different version of UrlRewriter.NET than what was used when these rules were created. 与创建这些规则时所使用的版本不同,我极有可能具有不同的UrlRewriter.NET版本。 Updating the syntax to the following, solved the problem: 将语法更新为以下内容可以解决此问题:

<if url="whywontthiswork\.aspx">
    <rewrite url="whywontthiswork\.aspx" to="/default.aspx" />
</if>

Edit: 编辑:
I was able to confirm that our production environment was using Intelligencia.UrlRewriter version 1.7.0 but the assembly I was using was 2.0. 我能够确认我们的生产环境正在使用Intelligencia.UrlRewriter 1.7.0版,但我正在使用的程序集是2.0版。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM