Created
March 2, 2015 20:41
-
-
Save dtanham/3ea5b1f1ff086d26ec58 to your computer and use it in GitHub Desktop.
JS Redirect to 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
if (window.location.href.indexOf("https://") != 0 && window.location.href.indexOf("http://localhost") == -1) { | |
window.location.href = window.location.href.replace("http://", "https://"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment