private void RedirectToCorrectSSLScheme() { Uri pageRequest = Request.Url; string requestPath = pageRequest.GetLeftPart(UriPartial.Path).ToLower(); requestPath = Server.UrlDecode(requestPath); // PageIsSecure returns if the given page should be secure or not. I //maintain a list of secure pages or //secure directory in an XML config. // bool securePage = GetSecurePages().PageIsSecure(requestPath); //Instead of localhost we can set the IP Address of Dubai server if (pageRequest.Scheme == "https" && pageRequest.Host.Contains("localhost") && requestPath.Contains(".aspx")) { //Response.Redirect("http://" + pageRequest.Host + pageRequest.PathAndQuery, true); Response.Redirect(requestPath, true); } //Added by Alex to check external url of qatar server //Instead of localhost we can set the IP Address of Dubai server if (pageRequest.Scheme == "http" && pageRequest.Host.ToString()!="localhost" && requestPath.Contains(".aspx")) { //Response.Redirect("https://" + pageRequest.Host + pageRequest.PathAndQuery, true); Response.Redirect(requestPath, true); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)