- 在C:\Windows\System32\drivers\etc\hosts文件中
127.0.0.1 www.tp5.com
127.0.0.1 localhost - 在 C:\wamp\bin\apache\apache2.4.23\conf\extra\httpd-vhosts.conf文件中
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.tp5.com
ServerAlias www.tp5.com
DocumentRoot c:/wamp/www/think/public
<Directory "c:/wamp/www/think/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>