Skip to content

Instantly share code, notes, and snippets.

@GeorgioWan
Forked from konklone/ssl-redirect.html
Created June 4, 2016 01:43
Show Gist options
  • Save GeorgioWan/6e2b45b6b9b04abc452a6a5d350cc150 to your computer and use it in GitHub Desktop.
Save GeorgioWan/6e2b45b6b9b04abc452a6a5d350cc150 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>
var host = "YOURDOMAIN.github.io";
if ((host == window.location.host) && (window.location.protocol != "https:"))
window.location.protocol = "https";
</script>
@GeorgioWan
Copy link
Author

And the final way for me is set up the Page Rule on CloudFlare. 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment