www 도메인으로 사용하기 문의드림니다
본문
동일 문제로 계속 문의 하는게 부끄러운데 아직도 헤메고 있어 문의드려요
계속 질문드려 여러 분 들이 도와 주셨는데 아무리 알려주신데로 .htaccess
파일을 넣어도 https://abc.com 에서 https://www.abc.com 으로 리디렉션이
안되고 있습니다
https://www.abc.com 도메인으로 사용 할수 있는 방법을 문의 드림니다
--------------------------------------------
.htaccess 원본 파일 입니다
#### 그누보드5 rewrite BEGIN #####
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
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>
# Start of www Redirect
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.betingosu.com [NC]
RewriteRule ^(.*)$ https://www.betingosu.com/$1 [L,R=301]
</IfModule>
# End of www Redirect
#### 그누보드5 rewrite END #####
---------------------------------------------------------------------------------------------
답변 2
#### 그누보드5 rewrite BEGIN #####
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# 추가된 부분: abc.com 도메인 리다이렉션
RewriteCond %{HTTP_HOST} !^www\.abc\.com [NC]
RewriteRule ^(.*)$ https://www.abc.com/$1 [L,R=301]
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 #####
# Start of www Redirect
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^betingosu.com [NC]
RewriteRule ^(.*)$ https://www.betingosu.com/$1 [L,R=301]
</IfModule>
# End of www Redirect
이렇게 적용해 보세요