Intelligencia UrlRewriter.NET 在 IIS 6 上无法正常工作?
我在使用以下语法时遇到问题:
<rewriter>
<!-- This does NOTHING -->
<if url="whywontthiswork\.aspx" rewrite="/default.aspx" />
<!-- This redirects correctly -->
<redirect url="whywontthiswork\.aspx" to="/default.aspx" />
</rewriter>
如上所述,无论我尝试什么,第一条规则都不会执行任何操作。该页面请求的响应中的 X-Powered-By 字段始终显示“ASP.NET”。但是,第二个重写规则始终有效,并且该请求的响应中的 X-Powered-By 字段为“ASP.NET,UrlRewriter.NET 2.0”。
我相信 IIS 配置正确,因为它正在正确处理
的请求。问题是我不知道为什么第一个重写规则不会执行。
我尝试在 UrlRewriter.NET 上搜索文档,但此时,似乎他们的网站是否离线或没有服役时间更长。有什么想法吗?
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". 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".
I believe that IIS is configured properly because it is handling the request correctly for <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. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,很抱歉回答我自己的问题,但我在发布此问题后不久就找到了解决方案。我很可能拥有与创建这些规则时使用的版本不同的 UrlRewriter.NET 版本。将语法更新为以下内容,解决了问题:
编辑:
我能够确认我们的生产环境使用的是 Intelligencia.UrlRewriter 版本 1.7.0,但我使用的程序集是 2.0。
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. Updating the syntax to the following, solved the problem:
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.