도메인 변경후 htaccess 301 리다이렉트

도메인 변경후 htaccess 301 리다이렉트

QA

도메인 변경후 htaccess 301 리다이렉트

답변 1

본문


RewriteCond %{HTTP_HOST} old\.com
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.old\.com(.*)  http://$1.new.com/$2  [L]
RewriteRule ^old\.com(.*)  http://new.com/$1  [L]

 

old.com에서 new.com으로 변경을했습니다. 

old.com으로 입력을하면 new.com으로 리다이렉트되서 들어가지는데

구글 검색결과에 나오는 

old.com/bbs/board.php?bo_table=xxx

old.com/bbs/new.php

등등 세부주소들은 리다이렉트가 안나오고 404 페이지없음 오류가 나오네요.

세부주소까지 리다이렉트를 할수있을까요?


이 질문에 댓글 쓰기 :

답변 1


RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !new.com$ [NC]
RewriteRule ^(.*)$ http://www.new.com/$1 [L,R=301]

 


RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !new.com$ [NC]
RewriteRule ^(.*)$ http://new.com/$1 [L,R=301]
 

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 125,873
© SIRSOFT
현재 페이지 제일 처음으로