2012-11-26 4 views
1

그래서 지금 어떤 도움을 부탁드립니다와 정말 붙어있어 작동하지로 리디렉션합니다. (301)는 예외

나는 다른 도메인으로하지만, 일부의 예외를 제외하고 사이트를 리디렉션하려합니다. 다음은 .htaccess 파일에있는 코드입니다.

RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_URI} !/sitemap/ 
RewriteCond %{REQUEST_URI} !/contact-us/ 
RewriteRule ^.*$ http://www.newsite.com/folder/$0 [R=301,L] 

Redirect 301 /sitemap/ http://www.newsite.com/sitemap/ 
Redirect 301 /contact-us/ http://www.newsite.com/contact-us/ 

이것이 작동하지 않는 이유는 무엇입니까?

홈 페이지와 사이트 맵 및 문의 페이지 괜찮 리디렉션 다른 모든 페이지는 리디렉션되지 않습니다.

미리 감사드립니다.

답변

0
리디렉션 라인 높은

RewriteEngine On 
Redirect 301 /sitemap/ http://www.newsite.com/sitemap/ 
Redirect 301 /contact-us/ http://www.newsite.com/contact-us/ 
RewriteBase/
RewriteCond %{REQUEST_URI} !/sitemap/ 
RewriteCond %{REQUEST_URI} !/contact-us/ 
RewriteRule ^.*$ http://www.newsite.com/folder/$0 [R=301,L] 

내 아파치 서버에이 시도하고

http://www.oldsite.com/sitemap/ => http://www.newsite.com/sitemap/ 
http://www.oldsite.com/contact-us/ => http://www.newsite.com/contact-us/ 
http://www.oldsite.com/test => http://www.newsite.com/folder/test 
근무를 이동