보통은 톰캣 서버 설정 등에서 자동으로 리다이렉트 시키도록 하지만 각 페이지마다 자바스크립트로 처리하거나 추가 검증을 시켜켜줄 수 있다.

 

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

if (document.location.protocol == 'http:') {
    document.location.href = document.location.href.replace('http:', 'https:');
}

 

+ Recent posts