困扰我好久的wampserver多站点配置总算解决了,实现在本地localhost环境下用多个不用的虚拟主机的方式访问不同的项目路径,从而增强实际的开发感觉哈哈~
现在记录一下配置方法:
①启动wampserver集成开发环境,然后在Apache目录下找到并打开httpd-vhosts.conf文件
②复制里面一份配置,然后根据自己的需要进行修改,如下图:

③接下来重启下wampserver集成开发环境
④打开本机的hosts文件对虚拟主机进行拦截映射,如下图
友情提示:hosts文件路径在C:\Windows\System32\drivers\etc

最后在api文件夹里新建一个index.php文件,编写点测试代码,保存。下面为多站点配置测试截图:


网友评论