강제 https 아파치 가상호스트에서 설정

강제 https 아파치 가상호스트에서 설정

QA

강제 https 아파치 가상호스트에서 설정

본문

https://sir.kr/so_server/1367

 

이걸 보고 적용중인데, 

<VirtualHost *:80>
        ServerAdmin *** 개인정보보호를 위한 이메일주소 노출방지 ***
        DocumentRoot "/home/test/www"
        ServerName 도메인
        RewriteEngine on
        RewriteCond %{REQUEST_URI} !^(/index\.php|/img/|/css/|/js/|/data/|/editor/|/.well-known/)
        RewriteRule ^(.*)$ /index.php/$1 [L]
        ErrorLog "logs/도메인-error_log"
        CustomLog "logs/도메인-access_log" combined
</VirtualHost>

 

현재 이렇게 가상호스트쪽에 적용하고 있는데,

이렇게 된거에 추가를 하면 

 

<VirtualHost *:80>
        ServerAdmin *** 개인정보보호를 위한 이메일주소 노출방지 ***
        DocumentRoot "/home/test/www"
        ServerName 도메인
        RewriteEngine on
        RewriteCond %{REQUEST_URI} !^(/index\.php|/img/|/css/|/js/|/data/|/editor/|/.well-known/)
        RewriteRule ^(.*)$ /index.php/$1 

        RewriteCond %{HTTPS} off
        RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
        ErrorLog "logs/도메인-error_log"
        CustomLog "logs/도메인-access_log" combined
</VirtualHost>

 

이렇게 바꾸면 되나요?

확인차 여쭙니다.

 

그리고 위의 글에는 

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteLog logs/rewrite_log
        RewriteCond %{HTTPS} off
        RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
</IfModule>

이걸 추가하라고 되어있는데 

<IfModule mod_rewrite.c>

</IfModule>

이건 굳이 없어도 되는건가요?

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 92
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT