Skip to content

Instantly share code, notes, and snippets.

@carolineschnapp
Last active June 21, 2021 20:39
Show Gist options
  • Save carolineschnapp/80eee3bab50f920f84b4 to your computer and use it in GitHub Desktop.
Save carolineschnapp/80eee3bab50f920f84b4 to your computer and use it in GitHub Desktop.
JavaScript redirect to force HTTPs
if (location.protocol !== "https:") {
location.protocol = 'https:';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment