我想根据以下规则IIS URL重写 - 重定向的子文件夹
https://www.test.com/abc重定向在我的网站的任何流量 - >https://www.test.com/test1.aspx?c=abc
https://www.test.com/def - >https://www.test.com/test1.aspx?c=def
子文件夹必须作为查询字符串
过去,我曾经尝试这样做,它似乎并没有工作。
<rule name="Reditect1" stopProcessing="true">
<match url="^(.*)test.com/(.*)" />
<conditions>
<add input="{R:2}" pattern="^[a-zA-Z0-9_]*$" />
</conditions>
<action type="Redirect" url="/test1.aspx?c={C:0}" appendQueryString="true" />
</rule>