IIS为虚拟目录重写多个规则

时间:2016-12-22 12:47:22

标签: iis url-rewriting

我有一个网站和一个名为prog的虚拟目录。查看以下条件的iis重定向规则。

1.i need to redirect all non www http request http://domain/prog  to https://www.domain/prog
2.redirect http  www request http://www.domain/prog to https://www.domain/prog
3.redirect https://domain/prog  to  https://www.domain/prog

我遵循以下网址 iis url redirect http to non www https

但是一个条件不起作用

https://domain/prog  to  https://www.domain/prog


<rewrite>
<rules>
  <rule name="SecureRedirect" stopProcessing="true">
    <match url="^(.*)$" />
    <conditions>
                    <add input="{HTTPS}" pattern="off" />
                    <add input="{HTTP_HOST}" pattern="^(www\.)?(.*)$" />
    </conditions>
    <action type="Redirect" url="https://www.{C:2}/prog" redirectType="Permanent" />
  </rule>
</rules>

1 个答案:

答案 0 :(得分:0)

我已经在prog虚拟目录上应用了url重写,并且已经工作了

apt-get install libopencv-dev