0

我想永久重定向

/?industry_id=3 to /industry/3/athletics

我尝试了规则:

 <rule>
    <from>/?industry_id=3$</from>
    <to type="permanent-redirect" last="true">/industry/3/athletics</to>
 </rule>

 <rule>
    <from>/&#63;industry_id=3$</from>
    <to type="permanent-redirect" last="true">/industry/3/athletics</to>
 </rule>


 <rule>
    <from>/\\?industry_id=3$</from>
    <to type="permanent-redirect" last="true">/industry/3/athletics</to>
 </rule>

 <rule>
    <from>/\?industry_id=3$</from>
    <to type="permanent-redirect" last="true">/industry/3/athletics</to>
 </rule>

但没有成功。

我试过这个:

 <rule match-type="regex">
    <note>Request page is deprecated</note>
    <condition type="query-string">industry_id=3</condition>
    <from>/</from>
    <to type="permanent-redirect" last="true">/industry/3/athletics</to>
 </rule>

这适用于重写,但是由于我猜的其他规则,我得到了“重定向太多”,即使设置了参数 last="true"

4

1 回答 1

1

这似乎很奇怪。以下对我有用:

<rule>
  <condition type="query-string">page=download</condition>
  <from>/</from>
  <to type="permanent-redirect" last="true">/downloads</to>
</rule>

正如您还提到的,您必须有其他一些干扰规则。

于 2013-04-05T05:44:08.767 回答