1、配置httpd.conf
在c:\xampp\apache\conf目录下,打开httpd.conf
改成下面这样
# Virtual hosts……虚拟主机
Include conf/extra/httpd-vhosts.conf
#DocumentRoot "c:/xampp/htdocs"
2、配置httpd-vhosts.conf
在C:\xampp\apache\conf\extra文件夹下,打开httpd-vhosts.conf
添加
#80端口
<VirtualHost *:80>
#管理员邮箱
ServerAdmin [email protected]
#网站主文件夹
DocumentRoot "C:/xampp/htdocs/"
#网址
ServerName www.abc.com
</VirtualHost>