Iis Url重写模块在浏览时也不工作
当我使用URL重写模块访问浏览器时,为什么这条规则不起作用?Iis Url重写模块在浏览时也不工作,iis,url-rewriting,url-rewrite-module,Iis,Url Rewriting,Url Rewrite Module,当我使用URL重写模块访问浏览器时,为什么这条规则不起作用? 它在带有url重写模块的正则表达式测试仪上工作。 我甚至把它放在我所有规则的首位 示例url:organizations/51/田纳西州中部篮球展示篮球比赛?page=1 重写规则: <rule name="Organization Redirect" stopProcessing="true"> <match url="^organizations/(.*)-basketball-tournaments\?
它在带有url重写模块的正则表达式测试仪上工作。
我甚至把它放在我所有规则的首位 示例url:
organizations/51/田纳西州中部篮球展示篮球比赛?page=1
重写规则:
<rule name="Organization Redirect" stopProcessing="true">
<match url="^organizations/(.*)-basketball-tournaments\?page=1$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="organizations/{R:1}" appendQueryString="false" />
</rule>
您的规则应如下所示:
<rule name="Organization Redirect" stopProcessing="true">
<match url="^organizations/(.*)-basketball-tournaments$" />
<conditions>
<add input="{QUERY_STRING}" pattern="^page=1$" />
</conditions>
<action type="Redirect" url="organizations/{R:1}" appendQueryString="false" />
</rule>
您不应在
url
测试中检查查询字符串(此处page=1
),而应在条件
部分检查。您的规则应如下所示:
<rule name="Organization Redirect" stopProcessing="true">
<match url="^organizations/(.*)-basketball-tournaments$" />
<conditions>
<add input="{QUERY_STRING}" pattern="^page=1$" />
</conditions>
<action type="Redirect" url="organizations/{R:1}" appendQueryString="false" />
</rule>
你不应该在
url
测试中检查查询字符串(这里page=1
),而应该在条件
部分检查。我真诚地认为他们应该将url
重命名为路径
,因为它确实是这样的…但是,这个模块仍然是一个非常好的模块!老实说,我认为他们应该将url
重命名为path
,因为它确实是这样的……但是,嘿,这个模块仍然是一个非常好的模块!