可以的,
hosts
127.0.0.1 www.test.com
apache conf
<VirtualHost 127.0.0.1>
DocumentRoot "D:/web/www"
ServerName www.test.com
<Directory "D:/web/www">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
Allow from 127.0.0.1
Deny from all
Require all granted
</Directory>
</VirtualHost>