使用ServerAlias方便客户访问
时间:2009-04-27 来源:lordling7
从Apache 官方文档里截取的
Many servers want to be accessible by more than one name. This is possible with the ServerAlias directive, placed inside the <VirtualHost> section. For example in the first <VirtualHost> block above, the ServerAlias directive indicates that the listed names are other names which people can use to see that same web site:
ServerAlias domain.tld *.domain.tld |
then requests for all hosts in the domain.tld domain will be served by the www.domain.tld virtual host. The wildcard characters * and ? can be used to match names. Of course, you can't just make up names and place them in ServerName or ServerAlias. You must first have your DNS server properly configured to map those names to an IP address associated with your server.
很多公司因工作需要架设了多个Web站点来,为了节省成本,通常将这些网站放在同一个服务器上,员工使用二级域名访问这些站点。但维护大量二级域名工作量很大,其实我们可以采用泛域名解析技术来解决这个难题