SORU
18 Ocak 2011, Salı


HTTP tespit veya JavaScript HTTPS force HTTPS sonra

HTTP veya HTTPS tespit ve JavaScript ile HTTPS kullanımını zorlaması için herhangi bir yolu var mı?

HTTP tespit için bazı kodlar var ama o https: kullanmak için zorlayamam HTTPS .

Kullanıyorumpencere.konum:protokolsite 3 ** Her neyse ayarlamak için özellik umarım yeni çiğnenmiş bir https URL tarayıcı yüklü yeniden yüklemek için sayfayı yenileyin.

if (window.location.protocol != "https:") {
   window.location.protocol = "https:";
   window.location.reload();
}

CEVAP
18 Ocak 2011, Salı


Bu deneyin

if (window.location.protocol != "https:")
    window.location.href = "https:"   window.location.href.substring(window.location.protocol.length);

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • ☆ SUB4SUB CENTER! ☆ spam here

    ☆ SUB4SUB

    22 ŞUBAT 2010
  • jcortes187

    jcortes187

    24 Mart 2006
  • Tire Rack

    Tire Rack

    31 Mayıs 2007