We help IT Professionals succeed at work.

HTTP to HTTPS redirect

nav2567
nav2567 asked
on
168 Views
Last Modified: 2017-05-31
Hello,

I have an in-house website which I need to redirect http to https for our uses.  

I am checking out this article:

http://stackoverflow.com/questions/14925566/iis-http-to-https-web-config-rewrite-doesnt-return-entire-url

Question, do I just edit the web.config file and add the below session at the end?  Do I need to modify thing?

<rule name="Redirect to HTTPS" stopProcessing="true">
  <match url="(.*)" />
  <conditions>
    <add input="{HTTPS}" pattern="^OFF$" />
  </conditions>
  <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
Comment
Watch Question

System Administrator, Networking Specialist
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Dan McFaddenSystems Engineer
CERTIFIED EXPERT

Commented:
The best way to do this (if you are insure where in the web.config xml node structure the rewrite rules belong) is to use IIS Manger to implement a rewrite rule.  By using the GUI, you will ensure that the configuration change for the site is saved to the correct place in the web.config.

The standard reference for the URL Rewrite feature in IIS, is below.

Link: http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/#redirect-https

Dan
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.