Skip to content

Instantly share code, notes, and snippets.

@digitup
Created July 9, 2012 08:48
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 digitup/3075195 to your computer and use it in GitHub Desktop.
Save digitup/3075195 to your computer and use it in GitHub Desktop.
JavaScript: HTTPtoHTTPS
<script type="text/javascript">var protocol=window.location.protocol;var url=window.location.href;if(protocol!="https:"){url="https:"+url.substring(protocol.length);window.location.replace(url);//console.log(url);}</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment