Skip to content

Instantly share code, notes, and snippets.

@JulianSoto
Forked from konklone/ssl-redirect.html
Created September 15, 2018 01:40
Show Gist options
  • Save JulianSoto/4a84b58ab063db1744b99fa8a283b244 to your computer and use it in GitHub Desktop.
Save JulianSoto/4a84b58ab063db1744b99fa8a283b244 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment