Skip to content

Instantly share code, notes, and snippets.

@Cnly
Forked from konklone/ssl-redirect.html
Last active October 4, 2015 10:44
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 Cnly/19d4c9477d1dda702fa0 to your computer and use it in GitHub Desktop.
Save Cnly/19d4c9477d1dda702fa0 to your computer and use it in GitHub Desktop.
Force a quick redirect to HTTPS on Github Pages for your domain (and only your domain)
<script>
if (window.location.host.indexOf('github.io') > -1 && window.location.protocol != "https:"){
window.location.protocol = "https";
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment