리눅스/apache
apache http를 https로 리다이렉트 설정
Rohin
2019. 12. 16. 17:52
반응형
vhost 파일에서 아래문구를 그대로 추가해주면 된다.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
예)
<VirtualHost *:80>
ServerName harulife.kr
DocumentRoot /home/haru
CustomLog /usr/local/apache/logs/harulife.kr
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>