apache2.2多域名虚拟主机泛解析
- 日期 : 2018-08-23
apache2.2多域名虚拟主机泛解析,打开apache配置文件C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\httpd.conf

搜索httpd-vhosts.conf将前面的#去掉保存
接着打开配置文件C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf
在底部加入
UseCanonicalName Off
ServerName *.123.com
ServerAlias *.123.com
VirtualDocumentRoot "D:/web/%1"
DirectoryIndex index.php
*.123.com就是你的泛域名VirtualDocumentRoot 就是目录

搜索httpd-vhosts.conf将前面的#去掉保存
接着打开配置文件C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf
在底部加入
UseCanonicalName Off
ServerName *.123.com
ServerAlias *.123.com
VirtualDocumentRoot "D:/web/%1"
DirectoryIndex index.php
*.123.com就是你的泛域名VirtualDocumentRoot 就是目录