[ Server ][ Linux ] 사이트 http를 https로 redirect 접속 www 삭제 또는 포함 후 redirect 접속 > linux

본문 바로가기
사이트 내 전체검색

linux

[ Server ][ Linux ] 사이트 http를 https로 redirect 접속 www 삭제 또는 포함 후 redire…

작성자 웹지기
작성일 19-11-01 22:18 | 조회 10,445 | 댓글 0

본문

domain.conf 파일에서 


# RewriteEngine on

# 아래코드는 http로 접속시 https로 변환하기 윈한 추가

# RewriteCond %{HTTPS} off

# RewriteCond %{SERVER_NAME} =www.newkoad.com [OR]

# RewriteCond %{SERVER_NAME} =www.dedibox.kr [OR]

# RewriteCond %{SERVER_NAME} =newkoad.com [OR]

# RewriteCond %{SERVER_NAME} =dedibox.kr

# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]


.htaccess 파일

www 없애고 접속 하기

# RewriteCond %{SERVER_NAME} ^www\.(.+) [NC]

# RewriteRule ^(.*) https://%1/$1 [R=301,NE,L]

 

www 추가하기

# RewriteCond %{SERVER_NAME} ^(?!www\.)(.+) [NC]

# RewriteRule ^(.*) https://www.%1/$1 [R=301,NE,L] 

 

 

0 0

댓글목록 0

등록된 댓글이 없습니다.

linux 목록

Total 103
게시물 검색

회원로그인

접속자집계

오늘
30,077
어제
17,832
최대
61,067
전체
17,969,189

그누보드5
Copyright © www.funyphp.com. All rights reserved.