Redirecting User To Secure Connection

if (!Request.IsSecureConnection)
{
    // send user to SSL 
    string serverName =HttpUtility.UrlEncode(Request.ServerVariables["SERVER_NAME"]);       
    string filePath = Request.FilePath;
    Response.Redirect("https://" + serverName + filePath);
}
Reactions

Post a Comment

0 Comments

Close Menu