vijay

welcome Netizen

Share Your Knowledge.It is a way to achieve immortality

Sunday, February 10, 2013

How to redirect the user automatically to Http to Https




Here I would like to share to redirect http to https when user enter http URL.
To know more about SSL working method you refer the below links...
Its common one when user can enter URL start with http on web browser. But as a developer, we must find and redirect the user to secure layer. By achieve the process number of method are following like write code on page load or in begin request. Here I have mentioned code would support for all dot net framework.

You need to add the below code on web config file.by doing so when user enter http url it will redirect t to https .
Also make sure you must check use SSL secure setting in IIS then add rule code on web.config file 

 <rule name="http to https" stopProcessing="true">
                    <match url=".*" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:0}" />
                </rule>


Please share the article with your friend by using sharing button…..


0 comments:

Post a Comment