【问题标题】:Redirect Url to new Url with ignoring parameters in web.config将 Url 重定向到新的 Url,忽略 web.config 中的参数
【发布时间】:2017-12-30 00:30:10
【问题描述】:

我想将我的旧网址 (../Galary.aspx?cat=10) 重定向到 新网址(../jacket-style-gallery) 但是它附加旧参数。

<rule name="rule9" stopProcessing="true">
  <match url="(.*)" /> 
  <conditions>  
    <add input="{QUERY_STRING}" pattern="cat=10" />  
  </conditions>  
  <action type="Redirect" url="./jacket-style-gallery" appendQueryString="false"/>
</rule> 

所以它重定向到“../jacket-style-gallery?cat=10”

【问题讨论】:

    标签: asp.net redirect iis web-config


    【解决方案1】:

    如果你只想要Galary.aspx

    要被重定向然后你应该使用:

    <rule name="rule9" stopProcessing="true">
      <match url="Galary.aspx" /> 
      <conditions>  
        <add input="{QUERY_STRING}" pattern="cat=10" />  
      </conditions>  
      <action type="Redirect" url="./jacket-style-gallery" appendQueryString="false"/>
    </rule> 
    

    我刚刚在我的服务器上进行了测试,它可以工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-19
      • 2011-12-18
      • 1970-01-01
      • 2021-04-17
      • 1970-01-01
      • 1970-01-01
      • 2011-08-06
      • 2020-12-11
      相关资源
      最近更新 更多