IIS重写失败

时间:2014-01-10 09:52:29

标签: c# iis

我想重写此网址:     https://localhost/My/Test.dll  进入这个:     https://localhost/My/Test.dll (这是GET mvc行动)

我使用这条规则:

https://localhost:444/Api/Test

在使用浏览器点击https://localhost:444/Api/Test时,我知道为什么会出现404错误信息? 我安装了URL Rewrite。 我是否还需要安装应用程序请求路由?

1 个答案:

答案 0 :(得分:1)

您尝试匹配的字符串不是查询字符串,而是URL中的路径。请尝试以下方法:

<rule name="Rewrite rule1 for Thing 2" patternSyntax="Wildcard" stopProcessing="true">
    <match url="My/Test\.dll" />
    <action type="Rewrite" url="Api/Test" appendQueryString="false" />
</rule>