Created
December 20, 2011 16:07
-
-
Save McPolemic/1502100 to your computer and use it in GitHub Desktop.
A redirect page for IIS in order to enforce HTTPS
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
<script language="JavaScript"> | |
<!-- begin hide | |
// Originally from http://raoulpop.com/2007/08/07/automatic-redirect-from-http-to-https/ | |
function SSLRedirect() | |
{ | |
if (window.location.protocol = "http:") | |
{ | |
var oldURL = window.location.hostname + window.location.pathname; | |
var newURL = "https://" + oldURL; | |
window.location = newURL; | |
} | |
} | |
SSLRedirect(); | |
// end hide --> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment