# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf
在对应的虚拟主机配置文件中加入
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.aaa.com$
RewriteRule ^/(.*)$ http://www.bbb.com/$1 [R=301,L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.aaa.com [OR]
RewriteCond %{HTTP_HOST} ^www.bbb.net$
RewriteRule ^/(.*)$ http://www.ccc.com/$1 [R=301,L]
</IfModule>
本文出自 “10897714” 博客,请务必保留此出处http://10907714.blog.51cto.com/10897714/1730670
原文:http://10907714.blog.51cto.com/10897714/1730670