Skip to content

Instantly share code, notes, and snippets.

@jamesbaber
Created March 1, 2016 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesbaber/b284f7b38c61c3318346 to your computer and use it in GitHub Desktop.
Save jamesbaber/b284f7b38c61c3318346 to your computer and use it in GitHub Desktop.
HTML Script Tag to Force HTTPS (SSL) on a Webpage
<script>
if (window.location.protocol != "https:")
window.location.href = "https:" + window.location.href.substring(window.location.protocol.length);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment