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="(.*)" />  
  <conditions>  
    <add input="{HTTPS}" pattern="^OFF$" />  
  </conditions>  
  <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />  
</rule>
WiggingAsked:
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
http://support.microsoft.com/kb/975341
0
 
edster9999Commented:
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.
0
 
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
0
 
WiggingAuthor Commented:
I am trying and it goes in a loop it says
0
 
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})
0
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.