Posted By

timpreneur on 04/01/11


Tagged


Versions (?)

Javascript redirect to SSL


 / Published in: JavaScript
 

Redirect to SSL script

  1. function redirectSecure()
  2. {
  3. if (document.location.protocol != “https:){
  4. var oldURL = window.location.hostname + window.location.pathname+window.location.search;
  5. var newURL = “https://” + oldURL;
  6. window.location = newURL;
  7. }
  8. }
  9. redirectSecure();

Report this snippet  

You need to login to post a comment.