Solved

Redirect to HTTPS

Posted on 2014-01-29
3
401 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 78

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now