要想多域名绑定同一目录的实现就要用到serveralias方法,下面我们以www.phpfensi.com为实例。
- namevirtualhost *:80
- <virtualhost *:80>
- servername web-demo
- serveralias www.phpfensi.com phpfensi.com
- documentroot "x:/www/htdocs"
- </virtualhost>
- <directory "x:/www/htdocs">
- options followsymlinks includesnoexec indexes
- directoryindex index.htm index.html index.php
- allowoverride none
- order deny,allow
- allow from all
- </directory>
注:域名之间以空格分开,要不就会绑定失败哦,还有重启你的apache服务器就ko了。 |