채택완료
http://www로 들어오는 주소를 https://www로 강제로 이동시키는방법좀요 ㅠㅠ
답변 2개
채택된 답변
+20 포인트
2015-07-03 (금) 08:22:55
아래코드 참고하세요.
if(!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == ""){ $redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("HTTP/1.1 301 Moved Permanently");
header("Location: $redirect");
}
Principle
2015-07-03 (금) 06:08:22
http://example.com/index.php 파일의 헤더에 다음을 넣으세요
<meta http-equiv="refresh" content="0; url=https://example.com/" />
답변을 작성하려면 로그인이 필요합니다.