questions - Question:Site is accessible under many different hostnames; how to redirect clients so that they see only a single name?


Many sites map a variety of hostnames to the same content. For example,, and 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:
1. Use mod_rewrite as described in the "Canonical Hostnames" section of the URL Rewriting Guide.
2. Use name-based virtual hosting:
NameVirtualHost *
Redirect permanent /
DocumentRoot /usr/local/apache/htdocs

asked Sep 13, 2013 in APACHE by rajesh
edited Sep 12, 2013
0 votes

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.