level 1
你需要的是,
再多设一个 VirtualHost 区块,
将其 DocumentRoot 设到 htdocs
假设你这区块的 ServerName 为 others.xxx.com
而且把这区块放在之前 VirtualHost 之前。
apache 会把所有访问做Host的检查,
如果符合任何一个 ServerName 就交给哪一区块处理,
如果没符合任何一个 ServerName,例如 www.xxx.com 或 1.2.3.4
就交给第一个 VirtualHost 区块来处理。
在 apache 上的手册是这样写的:
That means that if a request is received that does not match one of the specified ServerName directives, it will be served by this first VirtualHost.
2014年08月13日 23点08分
