SlideShare a Scribd company logo
1 of 7
Download to read offline
IIS7 Redirect HTTP to HTTPS
Compare SSL Certificates
Redirecting all traffic from HTTP to HTTPS in IIS7 will make sure your users always access the site securely. There are
many different ways to set up an IIS7 Redirect from HTTP to HTTPS and some are better than others. The ideal HTTP to
HTTPS redirect would do the following:

    •     Gently redirect users to HTTPS so users don’t have to type in “https” in the URL
    •     Redirect users to the specific page that they were going to go to on HTTP (page.htm)
    •     Save any variables passed in the query string (?page=2)
    •     Work in all browsers
    •     Transfer PageRank to the redirected page by using a 301 redirect, maintaining SEO
    •     Allow specific parts of a site to force SSL but allow HTTP on other parts of the site
    •     Redirect users from mydomain.com to www.mydomain.com
Unfortunately, there isn’t an easy way to satisfy all of these requirements, and most methods only satisfy a few of them.
The best method of doing an HTTP to HTTPS redirect I’ve seen involves using ASP.Net to do the HTTP to HTTPS
redirection.
But most people don’t need all of those features, so I have listed two of the best methods of redirecting HTTP to HTTPS
in IIS 7. They are easy to set up and effective in most situations.

Method 1 – Using Microsoft URL Rewrite Module
For this method of redirecting from HTTP to HTTPS, you will need to do the following;

    1. Install the Microsoft URL Rewrite Module

    2. Install your SSL certificate in IIS 7 and bind it to your website

    3. Make sure Require SSL is NOT checked under SSL Settings for your website (uncheck the boxes that are checked
       in this screenshot)




    4. Copy and paste the following code between the <rules> and </rules> tags in your web.config file in your website
       root directory.
<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>




    5. Test the site by going to http://www.yoursite.com and making sure it redirects

Method 2 – Setting up a Custom Error Page
The second method of setting up an IIS7 redirect HTTP to HTTPS is to Require SSL on the site or part of the site and set
up a custom 403.4 error page. To do this, just following these steps:

    1. Install your SSL certificate in IIS 7 and bind it to your website
    2. In IIS, click on the site name, and go to the SSL Settings section




    3. Check Require SSL and Require 128-bit SSL and click Apply
4. After doing this, users will normally receive this error:
5. Create a new text file and paste the following into it:

    <html>
    <head><title>Redirecting...</title></head>
    <script language="JavaScript">
    function redirectHttpToHttps()
    {
        var httpURL= window.location.hostname + window.location.pathname +
    window.location.search;
        var httpsURL= "https://" + httpURL;
        window.location = httpsURL;
    }
    redirectHttpToHttps();
    </script>
    <body>
    </body>
    </html>




6. Save the file as redirectToHttps.htm in your C:Inetpub directory
7. Back in IIS, click on the site name and double-click the Error Pages option




8. Click Add… and enter 403.4 as the Status code. Browse for the redirectToHttps.htm file you just created and
   click OK
9. Select the error code and press Edit Feature Settings…
10. Click the Custom error pages option and again browse for the redirectToHttps.htm file




   11. Test the site by going to http://www.yoursite.com and making sure it redirects

A caveat of using a custom error page to do an IIS7 redirect from HTTP to HTTPS is that the web browser must have
JavaScript enabled for the redirection to work.

    For more details about Cheap SSL Certificates, visit; https://www.rapidsslonline.com/

More Related Content

Viewers also liked

Varam jevgenija butnicka
Varam jevgenija butnickaVaram jevgenija butnicka
Varam jevgenija butnicka
Egils Doroško
 
Doi thoai voi_nguoi_do_dau_tinh_than
Doi thoai voi_nguoi_do_dau_tinh_thanDoi thoai voi_nguoi_do_dau_tinh_than
Doi thoai voi_nguoi_do_dau_tinh_than
Sự Kiện Hay
 

Viewers also liked (14)

Менять мир - модно - Ольга Иванова
Менять мир - модно - Ольга ИвановаМенять мир - модно - Ольга Иванова
Менять мир - модно - Ольга Иванова
 
Mito.Myth.
Mito.Myth.Mito.Myth.
Mito.Myth.
 
Varam jevgenija butnicka
Varam jevgenija butnickaVaram jevgenija butnicka
Varam jevgenija butnicka
 
Ищешь вдохновение? Просто выйди на улицу
Ищешь вдохновение? Просто выйди на улицуИщешь вдохновение? Просто выйди на улицу
Ищешь вдохновение? Просто выйди на улицу
 
12702889
1270288912702889
12702889
 
Social media-strategy-pmi-abbigliamento
Social media-strategy-pmi-abbigliamentoSocial media-strategy-pmi-abbigliamento
Social media-strategy-pmi-abbigliamento
 
Jaqueline Leal - Portfolio 2013
Jaqueline Leal - Portfolio 2013Jaqueline Leal - Portfolio 2013
Jaqueline Leal - Portfolio 2013
 
Feeding the 5000-2
Feeding the 5000-2Feeding the 5000-2
Feeding the 5000-2
 
Korona express hofzug in Bulgarien
Korona express hofzug in BulgarienKorona express hofzug in Bulgarien
Korona express hofzug in Bulgarien
 
Doi thoai voi_nguoi_do_dau_tinh_than
Doi thoai voi_nguoi_do_dau_tinh_thanDoi thoai voi_nguoi_do_dau_tinh_than
Doi thoai voi_nguoi_do_dau_tinh_than
 
Copiii orbi
Copiii orbiCopiii orbi
Copiii orbi
 
Ensaio Docol
Ensaio DocolEnsaio Docol
Ensaio Docol
 
Ohaguro Tradition
Ohaguro TraditionOhaguro Tradition
Ohaguro Tradition
 
High Performance Computing
High Performance ComputingHigh Performance Computing
High Performance Computing
 

More from RapidSSLOnline.com

More from RapidSSLOnline.com (20)

Tackle ERR_SSL_PROTOCOL_ERROR in Google Chrome
Tackle ERR_SSL_PROTOCOL_ERROR in Google ChromeTackle ERR_SSL_PROTOCOL_ERROR in Google Chrome
Tackle ERR_SSL_PROTOCOL_ERROR in Google Chrome
 
Viewing SSL Certificate in Chrome | RapidSSLonline
Viewing SSL Certificate in Chrome | RapidSSLonlineViewing SSL Certificate in Chrome | RapidSSLonline
Viewing SSL Certificate in Chrome | RapidSSLonline
 
Compare GeoTrust True BusinessID SSL Data Sheet
Compare GeoTrust True BusinessID SSL Data SheetCompare GeoTrust True BusinessID SSL Data Sheet
Compare GeoTrust True BusinessID SSL Data Sheet
 
Introducing TLS 1.3 – The future of Encryption
Introducing TLS 1.3 – The future of EncryptionIntroducing TLS 1.3 – The future of Encryption
Introducing TLS 1.3 – The future of Encryption
 
GUIDE ON INSTALLING SSL CERTIFICATE ON IBM HTTP SERVER
GUIDE ON INSTALLING SSL CERTIFICATE ON IBM HTTP SERVERGUIDE ON INSTALLING SSL CERTIFICATE ON IBM HTTP SERVER
GUIDE ON INSTALLING SSL CERTIFICATE ON IBM HTTP SERVER
 
Cybersecurity Compliance can Make or Break Your Business - DigiCert - Symantec
Cybersecurity Compliance can Make or Break Your Business - DigiCert - SymantecCybersecurity Compliance can Make or Break Your Business - DigiCert - Symantec
Cybersecurity Compliance can Make or Break Your Business - DigiCert - Symantec
 
Adobe Connect on-premise SSL Guide
Adobe Connect on-premise SSL GuideAdobe Connect on-premise SSL Guide
Adobe Connect on-premise SSL Guide
 
How to Move SSL Certificate from Windows Server to Another Windows Server
How to Move SSL Certificate from Windows Server to Another Windows ServerHow to Move SSL Certificate from Windows Server to Another Windows Server
How to Move SSL Certificate from Windows Server to Another Windows Server
 
Symmetric and Asymmetric Encryption
Symmetric and Asymmetric EncryptionSymmetric and Asymmetric Encryption
Symmetric and Asymmetric Encryption
 
SSL / TLS Validation | CASecurity.org | RapidSSLonline
SSL / TLS Validation | CASecurity.org | RapidSSLonlineSSL / TLS Validation | CASecurity.org | RapidSSLonline
SSL / TLS Validation | CASecurity.org | RapidSSLonline
 
Geek Guide: Apache Web Servers and SSL Authentication
Geek Guide: Apache Web Servers and SSL AuthenticationGeek Guide: Apache Web Servers and SSL Authentication
Geek Guide: Apache Web Servers and SSL Authentication
 
All About SSL/TLS
All About SSL/TLSAll About SSL/TLS
All About SSL/TLS
 
A Complete RapidSSL Guide on Securing Online Business with SSL Certificate
A Complete RapidSSL Guide on Securing Online Business with SSL CertificateA Complete RapidSSL Guide on Securing Online Business with SSL Certificate
A Complete RapidSSL Guide on Securing Online Business with SSL Certificate
 
Google Chrome 56 What You Need to Know?
Google Chrome 56   What You Need to Know?Google Chrome 56   What You Need to Know?
Google Chrome 56 What You Need to Know?
 
The Hidden Costs of SelfSigned SSL Certificates
The Hidden Costs of SelfSigned SSL Certificates The Hidden Costs of SelfSigned SSL Certificates
The Hidden Costs of SelfSigned SSL Certificates
 
5 Steps for Preventing Ransomware
5 Steps for Preventing Ransomware5 Steps for Preventing Ransomware
5 Steps for Preventing Ransomware
 
2016 Symantec Internet Security Threat Report
2016 Symantec Internet Security Threat Report2016 Symantec Internet Security Threat Report
2016 Symantec Internet Security Threat Report
 
How Does The Wildcard SSL Work?
How Does The Wildcard SSL Work?How Does The Wildcard SSL Work?
How Does The Wildcard SSL Work?
 
Uncover threats and protect your organization
Uncover threats and protect your organizationUncover threats and protect your organization
Uncover threats and protect your organization
 
A New Zero-Day Vulnerability Discovered Every Week in 2015
A New Zero-Day Vulnerability Discovered Every Week in 2015A New Zero-Day Vulnerability Discovered Every Week in 2015
A New Zero-Day Vulnerability Discovered Every Week in 2015
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Learn about IIS7 redirection http to https from Platinum CA RapidSSLonline

  • 1. IIS7 Redirect HTTP to HTTPS Compare SSL Certificates Redirecting all traffic from HTTP to HTTPS in IIS7 will make sure your users always access the site securely. There are many different ways to set up an IIS7 Redirect from HTTP to HTTPS and some are better than others. The ideal HTTP to HTTPS redirect would do the following: • Gently redirect users to HTTPS so users don’t have to type in “https” in the URL • Redirect users to the specific page that they were going to go to on HTTP (page.htm) • Save any variables passed in the query string (?page=2) • Work in all browsers • Transfer PageRank to the redirected page by using a 301 redirect, maintaining SEO • Allow specific parts of a site to force SSL but allow HTTP on other parts of the site • Redirect users from mydomain.com to www.mydomain.com Unfortunately, there isn’t an easy way to satisfy all of these requirements, and most methods only satisfy a few of them. The best method of doing an HTTP to HTTPS redirect I’ve seen involves using ASP.Net to do the HTTP to HTTPS redirection. But most people don’t need all of those features, so I have listed two of the best methods of redirecting HTTP to HTTPS in IIS 7. They are easy to set up and effective in most situations. Method 1 – Using Microsoft URL Rewrite Module For this method of redirecting from HTTP to HTTPS, you will need to do the following; 1. Install the Microsoft URL Rewrite Module 2. Install your SSL certificate in IIS 7 and bind it to your website 3. Make sure Require SSL is NOT checked under SSL Settings for your website (uncheck the boxes that are checked in this screenshot) 4. Copy and paste the following code between the <rules> and </rules> tags in your web.config file in your website root directory.
  • 2. <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> 5. Test the site by going to http://www.yoursite.com and making sure it redirects Method 2 – Setting up a Custom Error Page The second method of setting up an IIS7 redirect HTTP to HTTPS is to Require SSL on the site or part of the site and set up a custom 403.4 error page. To do this, just following these steps: 1. Install your SSL certificate in IIS 7 and bind it to your website 2. In IIS, click on the site name, and go to the SSL Settings section 3. Check Require SSL and Require 128-bit SSL and click Apply
  • 3. 4. After doing this, users will normally receive this error:
  • 4. 5. Create a new text file and paste the following into it: <html> <head><title>Redirecting...</title></head> <script language="JavaScript"> function redirectHttpToHttps() { var httpURL= window.location.hostname + window.location.pathname + window.location.search; var httpsURL= "https://" + httpURL; window.location = httpsURL; } redirectHttpToHttps(); </script> <body> </body> </html> 6. Save the file as redirectToHttps.htm in your C:Inetpub directory
  • 5. 7. Back in IIS, click on the site name and double-click the Error Pages option 8. Click Add… and enter 403.4 as the Status code. Browse for the redirectToHttps.htm file you just created and click OK
  • 6. 9. Select the error code and press Edit Feature Settings…
  • 7. 10. Click the Custom error pages option and again browse for the redirectToHttps.htm file 11. Test the site by going to http://www.yoursite.com and making sure it redirects A caveat of using a custom error page to do an IIS7 redirect from HTTP to HTTPS is that the web browser must have JavaScript enabled for the redirection to work. For more details about Cheap SSL Certificates, visit; https://www.rapidsslonline.com/