how to redirect to same domain from http to https in the application_beginrequest event in a class file complied as dll using c#.
i cant redirect to the same server... any suggestion...
how to redirect to same domain from http to https in the application_beginrequest event in a class file complied as dll using c#.
i cant redirect to the same server... any suggestion...
if (Request.Url.ToString.ToLower.StartsWith("http://")) {
Response.Redirect(Request.Url.ToString.Replace("http://", "https://"));
}
//Check if page is running under https. If not redirect to secure page...
if ((!HttpContext.Current.Request.IsSecureConnection))
{
HttpContext.Current.Response.Redirect("https://" + Context.Request.Url.Host + Context.Request.Url.PathAndQuery);
}