0

我想将 domain1.com 的每个子域重定向到 domain2.com

foo.domain1.com -> foo.domain2.com

baz.domain1.com -> baz.domain2.com

bar.domain1.com -> bar.domain2.com

etc
4

1 回答 1

0

https://stackoverflow.com/a/8046069/2024688

RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain1\.com$ [NC]
RewriteRule ^(.*)$ http://%1%2.domain2.com/$1  [L,R]
于 2013-06-17T05:50:41.490 回答