Return-Path:
$Revision: 1.12 $ ($Date: 2001/11/08 15:53:11 $) $Revision: 1.13 $ ($Date: 2001/11/08 15:58:31 $) The latest version of this FAQ is always available from the
main Apache web site, at <
Many sites map a variety of hostnames to the same content.
- (This differs from virtual hosting where
- different hostnames map to different content.) For example,
- Apache Server Frequently Asked
Questions
- www.example.com
, example.com
and
- www.example.net
may all refer to the same site.
- It is best to make sure that, regardless of the name clients
- use to access the site, they will be redirected to a single,
- canonical hostname. This makes the site easier to maintain
- and assures that there will be only one version of the site
- in proxy caches and search engines.www.example.com
,
+ example.com
and www.example.net
may
+ all refer to the same site. It is best to make sure that,
+ regardless of the name clients use to access the site, they
+ will be redirected to a single, canonical hostname. This
+ makes the site easier to maintain and assures that there will
+ be only one version of the site in proxy caches and search
+ engines.
There are two techniques to implement canonical hostnames:
@@ -680,20 +679,20 @@ virtual hosting:
-NameVirtualHost *
-
-<VirtualHost *>
- ServerName www.example.net
- ServerAlias example.com
- Redirect permanent / http://www.example.com/
-</VirtualHost>
-
-<VirtualHost *>
- ServerName www.example.com
- DocumentRoot /usr/local/apache/htdocs
+NameVirtualHost *
+
+<VirtualHost *>
+ ServerName www.example.net
+ ServerAlias example.com
+ Redirect permanent / http://www.example.com/
+</VirtualHost>
+
+<VirtualHost *>
+ ServerName www.example.com
+ DocumentRoot /usr/local/apache/htdocs
</VirtualHost>
-
+