Created
November 13, 2014 14:13
-
-
Save samirahmed/e591c27418655d4dbf72 to your computer and use it in GitHub Desktop.
https redirect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_BeginRequest() | |
{ | |
// Redirect to https always | |
if (!Context.Request.IsLocal && !Context.Request.IsSecureConnection) | |
Response.Redirect(Context.Request.Url.ToString().Replace("http:", "https:")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment