0
example.com에서 jp.example.com까지 "home /" 및 "car /"으로 시작하는 모든 URL과 유일한 URL을 리디렉션 할 수있는 방법이 필요합니다. 그래서 예를 들면이 경우에만 다시 쓰는 방법은 무엇입니까?
:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^jp.example.com$
RewriteRule ^(.*)$ http://jp.example.com/$1 [R=301]
하지만 jp.example.com
에 example.com의 모든 URL을 다시 있기 때문에 작동하지 않습니다이 코드를 사용하고example.com/home/test.html ---> jp.example.com/home/test.html
example.com/car/test.html ---> jp.example.com/car/test.html
jp.example.com/home/second-test.html ---> jp.example.com/home/second-test.html
jp.example.com/third-test.html ---> example.com/third-test.html