首先在apache/conf/httpd.conf配置文件中开启apache的vhost功能,搜索vhost,取消注释。
打开apache/conf/extra/httpd-vhosts.conf添加以下代码:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/"
ServerName localhost
<Directory "C:/wamp/www/">
DirectoryIndex index.html index.php
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>