【发布时间】:2011-01-31 19:22:01
【问题描述】:
我正在尝试使用 URL 重写模块在我的 IIS 7.0 服务器中重写 URL,但它不起作用。
我必须建立一个规则,以便从带有“;jsessionid=null”标记的第 3 部分验证页面接收 URL,该标记在调用我的页面时会在 IIS 中引发错误。我试图只删除“;jsessionid=null”语句。我需要我的应用程序的 URL 查询语句 (preceeding question)。
我写了这条规则:
图案:
(http://.*);jsessionid=null(.*)
行动:
{R:1}{R:2}
当我测试模式时,结果是好的。但在实践中,什么都没有发生,就像没有重写模块一样。在Web.config文件中好像没问题:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<rewrite>
<rules>
<rule name="refazer_url_autenticador_df" enabled="true" patternSyntax="ECMAScript" stopProcessing="false">
<match url="(http://.*);jsessionid=null(.*)" />
<action type="Rewrite" url="{R:1}{R:2}" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
当令牌在 URL 中时,IIS 会引发错误:
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
不用token(手动改写URL),一切正常。
怎么了?也许是规则,也许是另一个 ISS 配置?
谢谢!
【问题讨论】:
标签: iis-7 url-rewriting