Wednesday, September 23, 2015

Redirect http to https in IIS using URL ReWrite module

Suggested Videos
Part 99 - Implementing Enable button to unlock user accounts
Part 100 - Secure Socket Layer in asp.net
Part 101 - Implementing SSL in asp.net web application

In this video we will discuss about redirecting users from HTTP to HTTPS. In the previous session, we discussed about implementing SSL in asp.net. Please watch Part 101, before proceeding with this video.



To redirect users from HTTP to HTTPS automatically, there are several ways. In this video we will discuss about using "url rewrite" module. There are 3 simple steps

Step 1:
Please download and install "URL ReWrite" module from the following link.
http://www.iis.net/downloads/microsoft/url-rewrite

Step 2:
Uncheck "Require SSL" option from "SSL Settings" for the web application in IIS.



Step 3:
Copy and paste the following in the root web.config file of your application.
<system.webServer>
    <httpRedirect enabled="false" destination="" httpResponseStatus="Found" />
    <rewrite>
        <rules>
            <rule name="HTTP to HTTPS Redirection" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{HTTPS}" pattern="off" />
                </conditions>
                <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

Now try to navigate to the application using HTTP, you will automatically be redirected to HTTPS.

These rules can also be created in IIS directly using the "URL Rewrite" module

In the next video we will discuss about using "IIS Error Pages" to redirect users from HTTP to HTTPS automatically.


If you are searching life partner. your searching end with kpmarriage.com. now kpmarriage.com offer free matrimonial website which offer free message, free chat, free view contact information. so register here : kpmarriage.com- Free matrimonial website

0 comments:

Post a Comment