2013-07-26 2 views
1
RewriteCond %{HTTP_HOST} ^test.pl$ [NC] 
RewriteCond %{HTTP_HOST} ^(www\.)?test-test.pl$ [NC] 
RewriteCond %{HTTP_HOST} ^(www\.)?test-test.net$ [NC] 
RewriteRule ^(.*)$ http://www.test.pl/$1 [R=301,L] 

제가 도움이 필요합니다. 나는 'test.pl'을 입력해도 'www.test.pl'로 이동했지만 다른 도메인은 그대로 유지됩니다.더블 도메인 301 다시 작성

이렇게하고 싶습니다. '(www.) test-test.pl'또는 '(www.) test-test.net'[모두 4 개의 주소]를 입력하면 'www. test.pl '.

내 도메인이 무너져 내 서재응이 필요합니다. 도와주세요!

답변

0

OR을 잊어 버렸습니다.

OR이 없으면 다시 쓰기 엔진은 첫 번째 줄에서 구문 분석을 중지합니다. 그러나 그것은 간단하게 해결할 수 있습니다. 다음과 같이 작동하는 것이 좋습니다.

RewriteCond %{HTTP_HOST} ^test.pl$ [NC,OR] 
RewriteCond %{HTTP_HOST} ^(www\.)?test-test.pl$ [NC,OR] 
RewriteCond %{HTTP_HOST} ^(www\.)?test-test.net$ [NC,OR] 
RewriteRule ^(.*)$ http://www.test.pl/$1 [R=301,L]