我已经修改了我的 etc/hosts 文件(在 Windows 7 下),因此www.example.com
两者demo.example.com
都指向localhost
. 不幸的是demo.example.com
,访问将我带到本地主机的文档根目录(这是合乎逻辑的)。我想将其更改为指向demo.example.com
,demo.localhost
因此在 localhost 上创建一个新的虚拟子域,然后 etc/hosts 文件应该可以正常工作。
谁能指出我正确的方向?我有这个 vhosts 文件,它具有有效的语法,但似乎没有按我的意愿工作。
<VirtualHost 127.0.0.1:80>
ServerPath /demo-example/
ServerName demo.example.com
</VirtualHost>