Skip to content

Instantly share code, notes, and snippets.

@ajaidanial
Forked from konklone/ssl-redirect.html
Created November 21, 2020 21:38
Show Gist options
  • Save ajaidanial/b8f0f7cdaf2d22af4fd49ec3af0ebead to your computer and use it in GitHub Desktop.
Save ajaidanial/b8f0f7cdaf2d22af4fd49ec3af0ebead to your computer and use it in GitHub Desktop.

Revisions

  1. @konklone konklone revised this gist Apr 21, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ssl-redirect.html
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    <script>
    var host = "YOURDOMAIN.github.io";
    if ((host == window.location.host) && (window.location.protocol != "https:"))
    window.location = window.location.toString().replace(/^http:/, "https:");
    window.location.protocol = "https";
    </script>
  2. @konklone konklone renamed this gist Apr 4, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion ssl-redirect.js → ssl-redirect.html
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    <script>
    var host = "YOURDOMAIN.github.io";
    if ((host == window.location.host) && (window.location.protocol != "https:"))
    window.location = window.location.toString().replace(/^http:/, "https:");
    window.location = window.location.toString().replace(/^http:/, "https:");
    </script>
  3. @konklone konklone revised this gist Apr 4, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions ssl-redirect.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    var enforce = "YOURDOMAIN.github.io";
    if ((enforce == window.location.host) && (window.location.protocol != "https:"))
    var host = "YOURDOMAIN.github.io";
    if ((host == window.location.host) && (window.location.protocol != "https:"))
    window.location = window.location.toString().replace(/^http:/, "https:");
  4. @konklone konklone renamed this gist Apr 4, 2014. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions ssl-redirect.html → ssl-redirect.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    <script>
    var enforce = "YOURDOMAIN.github.io";
    if ((enforce == window.location.host) && (window.location.protocol != "https:"))
    window.location = window.location.toString().replace(/^http:/, "https:");
    </script>
    window.location = window.location.toString().replace(/^http:/, "https:");
  5. @konklone konklone created this gist Apr 4, 2014.
    5 changes: 5 additions & 0 deletions ssl-redirect.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    <script>
    var enforce = "YOURDOMAIN.github.io";
    if ((enforce == window.location.host) && (window.location.protocol != "https:"))
    window.location = window.location.toString().replace(/^http:/, "https:");
    </script>