【发布时间】:2012-02-10 11:12:23
【问题描述】:
我已经修改了我的 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>
【问题讨论】: