Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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