mod_vhost_alias
The mod_vhost_alias supports the dynamic configuration of document
roots and script directories for virtual hosts. This functionality is
useful when a server handles a large number of virtual hosts, usually
by varying the subdomain sections of the hostname. Virtual hosts
configured under the directives of this module are expected to share
the same configuration since they won’t have their
own <Virtual Directory>
sections.
The name of the virtual host is determined by the Host: header in the
client request. (This requires UseCanonicalName off
.) The IP address is the address assigned to the
particular virtual host. The directives of this module use either the
host name or IP address and interpolate it to locate unique document
and script paths for each host.
The interpolated path parameter for each
directive uses a printf-like format string to
refashion parts of the virtual hostname or address into a directory.
A %
-sign followed by a short format specifier
represent sections of the name in the interpolated directory. Each
word between the dots in a name or address is a section numbered from
left to right, starting with one. The whole name is represented by 0
(%0
). For example:
-
%0
The whole name
-
%2
The second section
-
%-1
The last section
-
%-2
The next-to-last section
-
%3+
The third section and all subsequent sections
Additionally, %p
represents the port number.
The settings of this module will be overridden by any mod_alias and mod_userdir settings on the same host ...
Get Webmaster in a Nutshell, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.