• TOP
케이홈테마 상담신청
  • 문의항목
  • 성함
  • 이메일
  • 연락처
  • 제목
Fullfill Heart, Design Dream
BUISINESS
기타
보안인증 강제다이렉트
  • 등록일2024.11.29
  • 조회수92

1. 그누보드일 경우 보안인증 강제다이렉트

 

 www/extend/user.config.php에 아래 내용으로 변경 또는 파일이 없다면 파일 만들어서 업로드

 

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

//https로 강제 접속
if($_SERVER['HTTPS'] != "on"){
   $ssl_port = "";  //  443 포트를 사용하지 않는경우에 이용할 포트번호 입력
   if ($ssl_port == "") {
       $redirect_URL = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
   } else {
       $redirect_URL = "https://".$_SERVER['HTTP_HOST'].":".$ssl_port.$_SERVER['REQUEST_URI'];
   }
   header("Location: ".$redirect_URL);
}
?>

 

 

2. 순수 html일 경우 보안인증 강제다이렉트

 

아래 스크립트 삽입

<script>
        if(location.hostname != "localhost") {
            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:');
            }
        }
    </script>
 

댓글 0

댓글목록

등록된 댓글이 없습니다.