Is redirecting http to https a bad idea?

前端 未结 6 1514
南旧
南旧 2020-12-04 09:50

I\'m reading over this page and it says that if a site is SSL and the user tries to access it via regular http, the application should not redirect the user to https. It sho

6条回答
  •  没有蜡笔的小新
    2020-12-04 10:29

    It's a perfectly acceptable "bootstrap" method - 301 redirect from HTTP to HTTPS then on the HTTPS side return a Strict-Transport-Security header in order to lock the browser into HTTPS.

    It would be a major usability issue to block HTTP entirely, as web browsers will attempt the HTTP protocol when a URL is entered without a protocol designator, unless the browser supports HSTS and an HSTS token is found in either the browser cache or the preload list.

提交回复
热议问题