Xesper's blog

AWS 처럼 앞단에서 ssl을 따로 처리하는 경우 http to https 리다이렉트 본문

Server/AWS

AWS 처럼 앞단에서 ssl을 따로 처리하는 경우 http to https 리다이렉트

윤종선 2018. 4. 26. 20:55

.htaccess에서 아래와 같이 바꾼다.


포인트는 HTTP:X-Forwarded-Proto를 사용해야 한다는점.






    RewriteEngine On


    RewriteCond %{HTTP:X-Forwarded-Proto} =http

    RewriteRule .* https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]

Comments