NameVirtualHost * <VirtualHost *> ... </VirtualHost> As mentioned in the previous section, the first virtual host present in the configuration file will answer requests for domains that are not explicitly handled by other virtual hosts. If you host multiple websites, it can be useful to set up that virtual host so it returns a page that either provides a list of available websites in the machine or explains why that particular website is not recognized. You can do so by placing such a file (default.html in the example in Listing 5.3) in the document root and redirecting all requests to it with an AliasMatch directive. You can achieve a similar effect replacing it with an ErrorDocument directive: ErrorDocument 404 /default.html Or you can even send users directly to one of your other websites with a Redirect directive. RedirectMatch /* http://www.example.com Listing 5.3. Configuring a Default Name-based Virtual Host
|