i have a website and one virtual directory called prog .looking an iis redirect rule for the following condition.
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
i have follow the below url iis url redirect http to non www https
but one condtion not working
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>