Solved

Redirect to HTTPS

Posted on 2014-01-29
3
405 Views
Last Modified: 2014-01-30
Hi There,

For the life of me I cannot get the http to redirect to https. Everything is supposed to be secure but as of now you can get to the non-secure version.

If I enable the redirect from within the IIS gui to "https://<FULL DOMAIN>" and then go to the site, I get a message that the site is in an infinite loop?

Thanks for your help!
0
Comment
Question by:chspayroll
  • 2
3 Comments
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 39819241
you can use the urlrewrite
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
  <match url="(.*)" />
    <conditions>
      <add input="{HTTPS}" pattern="off" ignoreCase="true" />
    </conditions>
  <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>

Open in new window


or a custom error page to redirect to https
http://www.sslshopper.com/iis7-redirect-http-to-https.html
0
 

Author Comment

by:chspayroll
ID: 39819288
Thanks, I've installed the url rewrite module but I can't reboot until later, I'll keep you posted
0
 

Author Closing Comment

by:chspayroll
ID: 39820922
Perfect! But I had to use the following code:

<rewrite>
      <rules>
      <rule name="HTTP to HTTPS redirect" stopProcessing="true">
              <match url="(.*)" />
                <conditions>
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                </conditions>
              <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
      </rule>
      </rules>
      </rewrite>
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question