1

我已经修改了我的 etc/hosts 文件(在 Windows 7 下),因此www.example.com两者demo.example.com都指向localhost. 不幸的是demo.example.com,访问将我带到本地主机的文档根目录(这是合乎逻辑的)。我想将其更改为指向demo.example.comdemo.localhost因此在 localhost 上创建一个新的虚拟子域,然后 etc/hosts 文件应该可以正常工作。

谁能指出我正确的方向?我有这个 vhosts 文件,它具有有效的语法,但似乎没有按我的意愿工作。

<VirtualHost 127.0.0.1:80>
ServerPath /demo-example/
ServerName demo.example.com
</VirtualHost>
4

1 回答 1

1

尝试像这样更改端口号

<VirtualHost 127.0.0.1:8080>
    ServerPath /demo-example/
    ServerName demo.example.com
</VirtualHost>
于 2012-01-14T18:23:49.623 回答