.htaccess 리다이렉을 이용하려고 하는데 http , www 에서 https로 넘어가지 않습니다...

.htaccess 리다이렉을 이용하려고 하는데 http , www 에서 https로 넘어가지 않습니다...

QA

.htaccess 리다이렉을 이용하려고 하는데 http , www 에서 https로 넘어가지 않습니다...

답변 1

본문

http://code.i-harness.com/ko/q/d548fb

여기를 참조해서

.htaccess를 

 

<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule> 
 

 

이렇게 적었는데요.

 

http로 접속하니 그대로 http네요..

http://www.sejukorea.com

https://www.sejukorea.com

 

어떻게 해야할지 막막합니다 ...

이 질문에 댓글 쓰기 :

답변 1

이렇게 해보세요.

 

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{HTTPS} off

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

</IfModule>

답변 감사합니다


RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

저는 4만번대 포트번호를 사용하는데

포트번호 없이 저기 주소를 수정해주니까 잘 돌아가네요 : )

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 70
© SIRSOFT
현재 페이지 제일 처음으로