Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

SSL https .net web site force redirect

On my web site I have the code below  in my master page as well as my stand alone login page
But When I do a scan for compliance I see this message
User generated imageWhat can I do to correct this?

            Dim context As HttpContext = HttpContext.Current
            If Not context.Request.IsSecureConnection Then
                Dim secureUrl As New UriBuilder(context.Request.Url)
                secureUrl.Scheme = "https"
                secureUrl.Port = 443
                context.Response.Redirect(secureUrl.ToString, False)
                Return
            End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Larry Brister

ASKER

Saige,
 Is there anything else that needs to happen in IIS for that?  I'm getting an HTTP IIS Error screen
What is the error message.  It is possible you have the rule in the wrong section.

-saige-