Home » 2013 » March » 10

Archive for March 10, 2013

HTTP – HTTPS Redirect

VB code If Not Request.IsLocal AndAlso Not Request.IsSecureConnection Then Dim redirectUrl As String = Request.Url.ToString().Replace(“http:”, “https:”) Response.Redirect(redirectUrl) End If C# code if (!Request.IsLocal && !Request.IsSecureConnection) { string redirectUrl = Request.Url.ToString().Replace(“http:”, “https:”); Response.Redirect(redirectUrl); } Classic asp Read more… ‘do https stuff dim httpsStuff httpsStuff = Request.ServerVariables(“PATH_INFO”) if Request.ServerVariables(“QUERY_STRING”) “” then httpsStuff = httpsStuff & “?” & […]