Thursday, February 19, 2015

Redirect from HTTP to HTTPS in SharePoint using IIS URL Rewrite Module

How to redirect http to https in SharePoint 2013:
Changing SharePoint site from http to https is a common requirement. URL Rewrite module is a great plugin for IIS to achieve various sort of redirects in your SharePoint site (or any web site technically!). Lets see how to implement HTTP to HTTPS redirect with IIS URL Rewrite Module.

Assuming you have SSL certificate for your website imported in IIS and 443 Binding is added. Also you have AAM Entry for HTTPS!

Prerequisites: Download and Install URL Rewrite module
As a prerequisite, you need to have URL rewrite module added to your web server. If its already installed in your web server , you'll find "URL Rewrite" module icon as below.
convert http to https sharepoint 2013

If its not installed already, Go to download and install URL rewrite module. Lets configure URL redirect to change SharePoint site from http to https.
change sharepoint site from http to https
Configure HTTP to HTTPS Redirect using URL Rewrite
  • Open IIS >> Select your web site from Sites node >> Open URL Rewrite module. 
  • Click on "Add Rules" link in the Actions menu and then select "Blank" inbound rule template. 
     sharepoint 2013 redirect from http to https
  • Provide a Name to the Rule. Say: "Redirect HTTP to HTTPS". Under "Match URL" Section: Set
    how to redirect http to https sharepoint 2013
    • Requested URL: Matches the Pattern
    • Using: Regular Expressions
    • Pattern: (.*)
  • Under "Conditions", Click on "Add" button to add a new condition
    how to change http to https in sharepoint
    • Condition Input: {HTTPS}
    • Check if input string: Matches the Pattern
    • Pattern: ^OFF$
      redirect http to https in sharepoint 2013
  • In Action Type Section, Set the following:
    sharepoint 2013 http to https url rewrite
    • Action Type: Redirect
      Redirect URL: https://{HTTP_HOST}/{R:1}
      Redirect Type: Permanent (301)
  • Click "Apply" from actions panel to save your changes!That's all. This converts http to https in SharePoint 2013.

These changes creates below entries in web.config file of the website.
                <rule name="Redirect HTTP to HTTPS" stopProcessing="true">
                    <match url="(.*)" />
                        <add input="{HTTPS}" pattern="^OFF$" />
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
Now, when a user hits any HTTP link on your site, the URL rewrite module redirects them to HTTPS of the same link!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...