Code to use HTTP to https permanent in CONFIG file?Below is the code to use to TRANSFER permanent http to https:-or we can write below codeprotected void Application_BeginRequest(Object sender, EventArgs e){ if (HttpContext.Current.Request.IsSecureConnection.Equals(FALSE) && HttpContext.Current.Request.IsLocal.Equals(false)) { Response.Redirect("https://" + Request.ServerVariables["HTTP_HOST"]+ HttpContext.Current.Request.RawUrl); }}
Your experience on this site will be improved by allowing cookies. Read Cookie Policy