Skip to content

Instantly share code, notes, and snippets.

@yehgdotnet
Last active May 9, 2020 04:58
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 yehgdotnet/d745d23169d73f14ecf5fbf31f47d23c to your computer and use it in GitHub Desktop.
Save yehgdotnet/d745d23169d73f14ecf5fbf31f47d23c to your computer and use it in GitHub Desktop.
JavaScript HTTPS Redirector
<script>
var original_url = window.location.toString();
var https_url = original_url.replace("http://","https://");
if (window.location.toString().indexOf("http://")==0){
location.replace(https_url);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment