채택완료

http://www로 들어오는 주소를 https://www로 강제로 이동시키는방법좀요 ㅠㅠ

2015-07-03 (금) 01:23:16 4,401

www.도메인.com

이나

도메인.com

으로 접속하는 경로를

강제로 https://도메인.com

으로 보내려면 어떻게 해야하나요

컨픽인가 어디에 뭐하나 추가로 적어넣으면 된다고 들은거 같긴해요 ㅠㅠ 

|

답변 2개

채택된 답변
+20 포인트
2015-07-03 (금) 08:22:55

아래코드 참고하세요.

if(!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == ""){
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: $redirect");
}

http://example.com/index.php 파일의 헤더에 다음을 넣으세요

<meta http-equiv="refresh" content="0; url=https://example.com/" />​ 

답변을 작성하려면 로그인이 필요합니다.