Bağlantıda HTTPS Kontrolü Yap - Javascript


Verilen bağlantının https ile başlayıp başlamadığını kontrol eden ve eğer http ile başlıyorsa bunu https ile değiştiren javascript kodu alternatifidir.

Kod


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

Etiketler
javascript