if (document.location.protocol != "https:") { document.location = document.URL.replace(/^http:/i, "https:"); }