SSL 보안인증서 적용후 https로 접속되게 하는 방법 > Linux

STUDY ROOM

Linux

SSL 보안인증서 적용후 https로 접속되게 하는 방법

페이지 정보

작성자 JMStudy 작성일21-02-02 10:45 조회4,707회 댓글0건

본문

.htaccess 


RewriteEngine On


RewriteCond %{HTTPS} off

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


위 조건으로 적용이 안되면 아래 조건으로

RewriteCond %{HTTPS} off

RewriteCond %{HTTP:X-Forwarded-Proto} !https

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



<VirtualHost *:80>

   DocumentRoot /home/jmstudy/public_html

   ServerName jmstudy.net

   ServerAlias www.jmstudy.net


   RewriteEngine On 

   RewriteCond %{HTTPS} off

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

</VirtualHost> 

댓글목록

등록된 댓글이 없습니다.