# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

在对应的虚拟主机配置文件中加入

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.aaa.com$

RewriteRule ^/(.*)$ http://www.bbb.com/$1 [R=301,L]

 

RewriteEngine on 

RewriteCond %{HTTP_HOST} ^www.aaa.com [OR] 

RewriteCond %{HTTP_HOST} ^www.bbb.net$ 

RewriteRule ^/(.*)$ http://www.ccc.com/$1 [R=301,L]