1、找到 D:\phpStudy\Apache\conf\httpd.conf ,将 #Include conf/extra/httpd-vhosts.conf的 # 号去掉
2、找到 D:\phpStudy\Apache\conf\extra\httpd-vhosts.conf ,手动添加一下代码
<VirtualHost *:80>
ServerAdmin
[email protected]DocumentRoot "D:\phpStudy\WWW\XXXX"
ServerName
http://www.XXXX.comErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
3.重启phpstudy
家里和公司的电脑上都安装了phpstudy,但家里的就不会出现配置了虚拟域名后会跳到根目录的情况,曾怀疑是phpstudy的版本的问题,可是卸载了又下了其他链接的版本安装后还是一样,百度多次之后,找到了原因,如果又遇到这种情况的可以照着我的方法解决