[ Team LiB ] |
Recipe 4.4 Creating a Default Address-Based Virtual HostProblemYou want to create a virtual host to catch all requests that don't map to one of your address-based virtual hosts. SolutionUse the _default_ keyword to designate a default host: <VirtualHost _default_> DocumentRoot /www/htdocs </VirtualHost> DiscussionThe _default_ keyword creates a virtual host that catches all requests for any address:port combinations for which there is not a virtual host configured. The _default_ directive may be used in conjunction with a particular port number, such as: <VirtualHost _default_:443> Using this syntax means that the specified virtual host catches all requests to port 443, on all addresses for which there is not an explicit virtual host configured. This is the usual way to set up SSL, which you see in the default SSL configuration file. _default_ typically does not work as people expect in the case of name-based virtual hosts. It does not match names for which there are no virtual host sections, only address:port combinations for which there are no virtual hosts configured. If you wish to create a default name-based host, see Recipe 4.2. See Also |
[ Team LiB ] |