프로그래밍/개발새발

https www 강제로 붙이기 .htaccess

◎◇ 2021. 5. 22. 00:27

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

 

(구버전)

<IfModule mod_rewrite.c>

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]

</IfModule>

---

 

원본

https://xetown.com/tips/147293

 

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