IIS使用查询字符串重写

时间:2015-03-13 13:27:59

标签: redirect iis rewrite

我已更改了我的代码页的网址,需要使用IIS进行重定向。有人可以帮助我吗?

旧页面

/ odla /?tag =不同的关键字

新页面

/ odla / index /?tag =不同的关键字

谢谢/ Niklas

1 个答案:

答案 0 :(得分:0)

您需要在web.config中执行重写规则:

<rule name="MyRule" patternSyntax="Wildcard" stopProcessing="true">
    <match url="*" />
        <conditions>
            <add input="{REQUEST_URI}" pattern="*/odla/?tag=*"/>
        </conditions>
    <action type="Rewrite" url="http://yourserver/odla/index/?tag={R:2}" />
</rule>