今天设置伪静态的时候碰到问题,琢磨半天不得其解,最后发现是次序问题,Test.asp?menu={R:1}&mediaID={R:2}这样的规则应该写在Test.asp的前面,否则达不到效果,有点奇葩。
<rule name="rule1" stopProcessing="true">
<match url="^Test-([A-Za-z0-9-]+)-([0-9]+)" />
<action type="Rewrite" url="Test.asp?menu={R:1}&mediaID={R:2}" />
</rule>
<rule name="rule2" stopProcessing="true">
<match url="^Test-([0-9]+)" />
<action type="Rewrite" url="Test.asp?stype={R:1}" />
</rule>
<rule name="rule3" stopProcessing="true">
<match url="^Test" />
<action type="Rewrite" url="Test.asp" />
</rule>
时间: 2024-10-07 03:45:39