繁体   English   中英

IIS重写规则不起作用

[英]IIS rewrite rule doesn't work

我只想将Radio / Play?stationId = 124重定向到station / 124,但以下配置不起作用。 我的配置中的其他规则有效,因此重写模块可以正常工作。

<rule name="radio-play" stopProcessing="true">
   <match url="^Radio/Play?stationId=([0-9]+)" ignoreCase="true" />
   <action type="Redirect" url="station/{R:1}" redirectType="Permanent" />
</rule>

配置有什么问题?

处理查询字符串参数是不同的。 这是正确的方法。

    <rule name="radio-play" stopProcessing="true">
      <match url="^radio/play" ignoreCase="true" />
      <conditions>
        <add input="{QUERY_STRING}" pattern="stationid=(\d+)"  ignoreCase="true"/>
      </conditions>
      <action type="Redirect" url="istasyon/{C:1}" redirectType="Permanent"  appendQueryString="false"/>
    </rule>

暂无
暂无

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

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