IIS 7 HOSTING - HOW TO REDIRECT HTTP TO HTTPS USING IIS7.0

Sep 16
08:51

2013

Jane Gibson

Jane Gibson

  • Share this article on Facebook
  • Share this article on Twitter
  • Share this article on Linkedin

IIS 7 has a new User Interface and a new configuration system. In this article Sudeep provides step-by-step information on how to configure HTTP to HTTPS redirection which is a common requirement for Microsoft Exchange.

mediaimage

Redirecting an HTTP connection to HTTPS is a very common requirement for applications that use SSL channel. A common example is Outlook Web Access (OWA). With Internet Information Services 7.0,IIS 7 HOSTING - HOW TO REDIRECT HTTP TO HTTPS USING IIS7.0 Articles we have a new configuration system and a new user interface. Here are the steps that you will need to automatically redirect an HTTP connection to HTTPS. This will ensure your users always accessing the site securely. There are many ways to redirect http to https, however I believe in below ideal principle :

  • 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 http://www.mydomain.com

Below is my way of redirecting http to https after few research and testing. The 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.

  1. Install your SSL certificate in IIS 7 and bind it to your website
  2. In IIS, click on the site name > go to SSL Settings section
  3. Check Require SSL and Require 128-bit SSL > Apply
  4. After doing this, users will receive this error:

5.   Create a new txt file and paste the following:

6.  Save the file as redirectToHttps.htm in your C:\Inetpub directory > Go back in IIS > click on site name > double-click the Error Pages option

7.  Click Add > enter 403.4 as the Status code > Browse for the redirectToHttps.htm file you created > OK > Select the error code > Edit Feature Settings… > Click Custom error pages option > browse for redirectToHttps.htm file

8. Test the site and making sure it redirects

Note : Using a custom error page to redirect from HTTP to HTTPS using IIS 7.0 is the web browser must have JavaScript enabled for the redirection to work