- 등록일2024.11.29
- 조회수91
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>