IT 이야기/Application
[Application] 로그인 페이지 등 특정 페이지를 http에서 https로 리다이렉션
찬찬이 아빠
2019. 11. 20. 16:15
반응형
로그인 페이지 등 특정 페이지를 http에서 https로 리다이렉션 하려면 어떻게 해야 할까요?
https로 서비스할 jsp 파일의 scripts에 다음과 같이 등록합니다.
1 2 3 4 5 6 7 8 9 | <scripts> function changUrl() { var currentAddress = location.href; if (currentAddress.indexOf ("http://") == 0) { currentAddress = currentAddress.replace("http://", "https://"); location.href = currentAddress; } } </scripts> | cs |
반응형