코드이그나이터 기반 PHP 오픈소스 게시판 : 씨아이보드

강제로 www 없애고 https로 이동하게 하기

  • 싸나이
  • 1
  • 5,475
  • 글주소
  • 07-17

CIBOARD 의 루트에 있는 .htaccess 파일을 열어서

 

맨 아래에 아래의 내용을 추가합니다.

 

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

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

 

위와 같이 설정하면 아래와 같이 작동합니다.

 

1. http://example.com -> https://example.com

2. http://www.example.com -> https://example.com

3. https://www.example.com -> https://example.com

 

끝.