How would I create an automatic redirect from the http to the https site in Windows Server 2008 R2?

I need to create an automatic redirect from http to the https site.
I asked a similar question in Expert Exchange and was told to use http redirect in IIS 7. However, this does not work as it creates an endless loop that can not be resolved by Firefox.  There must be other ways of solving this issue. Please advise. Thanks
PDSWSSAsked:
Who is Participating?
 
Brad HoweDevOps ManagerCommented:
Hi,

A typical example is this URL: http://www.domain.com. If you follow it you will see that browser gets redirected to https://www.domain.com.

To do this, you need the rewrite module.

URL Rewrite Module
http://www.iis.net/download/URLRewrite

With URL Rewrite Module you can perform this kind of redirection by using the following rule:

<rule name="Redirect to HTTPS" stopProcessing="true">
  <match url="(.*)" />
  <conditions>
    <add input="{HTTPS}" pattern="^OFF$" />
    <add input="{HTTP_HOST}" pattern="^www\.domain\.com" />
  </conditions>
  <action type="Redirect" url="https://www.domain.com/{R:1}" />
</rule>

Cheers,
Hades666
0
 
Neil RussellTechnical Development LeadCommented:
You configured it wrong then! All you would do is create an HTTP redirect in IIS7 to the HTTPS://sitename.org
0
 
PDSWSSAuthor Commented:
Looks pretty simple. Did not expect issues.

Since 443 is already taken the

http redirect is to  https:/www.sitename.edu:8000     The https site connects perfectly everytime.

I have attached the configuration that I used. Is there something wrong here?  Thanks,
Picture-3.png
0
How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

 
PDSWSSAuthor Commented:
I have attached the message I get from Firefox when I attempt to redirect from http to the https site

I have tried this on two different servers and get identical behavior. Thanks
Picture-4.png
0
 
TAWpowerCommented:
IIS 7.5 works different than 7... A bit painful. I used this technique...

http://www.thomasmaurer.ch/2010/11/how-to-redirect-sites-to-https-in-iis-7-5/

0
 
PDSWSSAuthor Commented:
TAWPower:

Followed the instructions in your link to redirect by editing the 403 page. However, did not work.  No different than not editing the 403 page. Still get error.

Is there anything that is left out of these instructions to successfully configure the redirect from http?  Thanks
0
 
PDSWSSAuthor Commented:
Hades666

In both places below where text =  www.\domain\.com     and    https://domain.com
I should replace with the URL of my site or just for the second one?

In addition because  443 was already taken  the  https  address  = https://www.domain.edu:port#   Will this type of address work in this configuration? Thanks

<add input="{HTTP_HOST}" pattern="^www\.domain\.com" />
  </conditions>
  <action type="Redirect" url="https://www.domain.com/{R:1}" />
0
 
PDSWSSAuthor Commented:
I meant to give Hades666 the 500 points. Please reopen so I can make it right.  Thanks
0
 
PDSWSSAuthor Commented:
Thanks. All the other solutions were wrong.
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.