D:serverapacheconf httpd.conf
#开启虚拟主机 Include conf/extra/httpd-vhosts.conf
D:serverapacheconfextra httpd-vhosts.conf
<VirtualHost *:80> DocumentRoot "E:/shop" -- 指定文件夹路径:网站根目录 ServerName www.shop.com -- 指定别名:主机名 <Directory "E:/shop"> -- 限定目录权限 AllowOverride All Options FollowSymLinks Order Allow,Deny -- 权限管理顺序 Allow from all -- 权限处理 DirectoryIndex index.php index.html -- 先找index.php 找不到就找index.html </Directory> </VirtualHost>
C:WindowsSystem32driversetc hosts
127.0.0.1 www.shop.com