iis redirect from http to https

This code below is very close but my website is inside a sub folder......that subfolder is an app in iis7

Domain is  http:// www.mydomain.com/chat

I want to always redirect to https://www.mydomain.com/chat

<rule name="Redirect to HTTPS" stopProcessing="true">  
  <match url="(.*)" />  
    <add input="{HTTPS}" pattern="^OFF$" />  
  <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />  
Who is Participating?
MAS (MVE)Connect With a Mentor Technical Department HeadCommented:
Please check this. This is for exchange but it is similar in IIS7
Add 2 web servers into the setup in IIS.
List one on port 80 (the normal web one) and one on port 443 (the SSL one).
The SSL one is the full web site.
the port 80 one has the redirect.  You can do it in the GUI without writing rules.
WiggingAuthor Commented:
we already have https installed in the server.....
all i need is that when people come to    domain.com/chat       they get redirected to   https://www.domain.com/chat

Just for security issues
WiggingAuthor Commented:
I am trying and it goes in a loop it says
WiggingAuthor Commented:
when using this in url rewrite
  <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />

my site is going from  
www.site.com/chat     to    https://www.site.com/

How can I add the folder chat?  ({HTTP_HOST}/{R:1})
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.