http.conf配置文件添加修改如下:
# Virtual Hosting Map RewriteEngine on RewriteMap lowercase int:tolower RewriteMap vhost txt:/usr/local/apache2/conf/vhost.map RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$ RewriteCond ${vhost:%1} ^(/.*)$ RewriteRule ^/(.*)$ %1/$1
vhost.map文件中添加域名和网站路径:
www.site1.com /www/site1 www.site2.com /www/site2