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 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=".*" />
                        <add input="{HTTPS}" pattern="off" />
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:0}" />

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


Post a Comment