기타 | .htaccess파일의 rewriterule 설정 http > https 처리
페이지 정보
작성자 위토즈 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일22-02-16 09:41 조회577 회 댓글0 건관련링크
본문
http > https 처리
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
</IfModule>
또는
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC] ## https로 접근한게 아니거나 www가 붙어 있으면
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] ## 주소에 www가 있으면 제거
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_URI} !^/?(html)/
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301] ## 위에서 변경한 주소를 https 로 다시 접속
댓글목록
등록된 댓글이 없습니다.