apache实现域名转向
时间:2010-05-17 来源:xhq6632
1、将abc.123.com转向到另外一个域名html.abc.com
<VirtualHost *:80>
DirectoryIndex index.html index.php
ServerName "abc.123.com"
DocumentRoot "/srv/www/htdocs/"
RedirectMatch ^/(.*)$ http://html.abc.com/$1
</VirtualHost> 2、将同一域名的主域名转向到子域名 如123.com转向bb.123.com <VirtualHost *:80>
DirectoryIndex index.html index.php
ServerName "123.com"
DocumentRoot "/srv/www/htdocs/"
RedirectMatch ^/(.*)$ http://bb.123.com/$1
</VirtualHost>
DirectoryIndex index.html index.php
ServerName "abc.123.com"
DocumentRoot "/srv/www/htdocs/"
RedirectMatch ^/(.*)$ http://html.abc.com/$1
</VirtualHost> 2、将同一域名的主域名转向到子域名 如123.com转向bb.123.com <VirtualHost *:80>
DirectoryIndex index.html index.php
ServerName "123.com"
DocumentRoot "/srv/www/htdocs/"
RedirectMatch ^/(.*)$ http://bb.123.com/$1
</VirtualHost>
相关阅读 更多 +