클라우드플레어로 옮긴 뒤 워드프레스 강제 https 적용 htaccess 파일 수정 방법

373 0 0
클라우드플레어로 옮긴 뒤에 DNS 프록싱을 하면 미국으로 적용돼서 속도 손실이 생기는 것 같아서 DNS only로 바꿨더니 https 자동 적용 같은 보안 기능이 제대로 되지 않습니다.
SSL/TLS - 개요 - SSL/TLS 암호화 모드를 Full(전체)로 맞춘 후
htaccess 파일은 아래와 같이 수정했습니다.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
http로 접속해도 강제로 https로 잘 바꿔줍니다.