https 자동이동 RewriteRule cafe24설정

cafe24에서 설정해준 것

 

#<IfModule mod_rewrite.c>
#RewriteEngine On
#RewriteBase /
 
#RewriteCond %{HTTP_HOST} ^www.도메인.com$ [NC]
#RewriteRule ^ https://도메인.com%{REQUEST_URI} [R=301,L]

#RewriteCond %{HTTPS} off
#RewriteCond %{HTTP:X-Forwarded-Proto} !https
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#</IfModule>  
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{ENV:HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>

 

※주의 : cafe24 루트디렉토리(/)의 .htaccess 파일 외 www 디렉토리에 .htaccess파일이 있으면 해당 것으로 적용됨 

 

최근 그누보드에서 루트디레토리 아래 www디렉토리에  .htacess 파일이 생김. 이 경우 아래와 같이 두줄 추가하면 됨

 


#### 그누보드5 rewrite BEGIN #####
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{ENV:HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]


RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^shop/list-([0-9a-z]+)$  shop/list.php?ca_id=$1&rewrite=1  [QSA,L]
RewriteRule ^shop/type-([0-9a-z]+)$  shop/listtype.php?type=$1&rewrite=1  [QSA,L]
RewriteRule ^shop/([0-9a-zA-Z_\-]+)$  shop/item.php?it_id=$1&rewrite=1  [QSA,L]
RewriteRule ^shop/([^/]+)/$  shop/item.php?it_seo_title=$1&rewrite=1  [QSA,L]
RewriteRule ^content/([0-9a-zA-Z_]+)$  bbs/content.php?co_id=$1&rewrite=1  [QSA,L]
RewriteRule ^content/([^/]+)/$  bbs/content.php?co_seo_title=$1&rewrite=1      [QSA,L]
RewriteRule ^rss/([0-9a-zA-Z_]+)$  bbs/rss.php?bo_table=$1        [QSA,L]
RewriteRule ^([0-9a-zA-Z_]+)$  bbs/board.php?bo_table=$1&rewrite=1      [QSA,L]
RewriteRule ^([0-9a-zA-Z_]+)/([^/]+)/$ bbs/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1      [QSA,L]
RewriteRule ^([0-9a-zA-Z_]+)/write$  bbs/write.php?bo_table=$1&rewrite=1    [QSA,L]
RewriteRule ^([0-9a-zA-Z_]+)/([0-9]+)$  bbs/board.php?bo_table=$1&wr_id=$2&rewrite=1  [QSA,L]
</IfModule>
#### 그누보드5 rewrite END #####
 

|

댓글 3개

좋은 팁 주셔서 감사합니다.
좋은 정보 알려주셔서 감사합니다.
감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
4년 전 조회 4,555
4년 전 조회 4,730
4년 전 조회 6,732
4년 전 조회 4,898
4년 전 조회 4,754
4년 전 조회 3,418
4년 전 조회 5,008
4년 전 조회 3,967
4년 전 조회 2,704
4년 전 조회 3,281
4년 전 조회 3,144
4년 전 조회 3,772
4년 전 조회 3,007
4년 전 조회 3,580
4년 전 조회 4,446
4년 전 조회 4,122
4년 전 조회 4,084
4년 전 조회 3,367
4년 전 조회 6,299
4년 전 조회 4,629
4년 전 조회 5,688
4년 전 조회 4,640
4년 전 조회 4,858
4년 전 조회 5,804
4년 전 조회 4,930
4년 전 조회 3,735
4년 전 조회 7,389
4년 전 조회 5,534
4년 전 조회 2,761
4년 전 조회 5,003