Organizational Research By

Surprising Reserch Topic

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, 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:
 
1. Use mod_rewrite as described in the "Canonical Hostnames" section of the URL Rewriting Guide.
 
2. Use name-based virtual hosting:
 
NameVirtualHost *
 
 
ServerName www.example.net
 
ServerAlias example.com
 
Redirect permanent / http://www.example.com/
 
 
 
ServerName www.example.com
 
DocumentRoot /usr/local/apache/htdocs
 
 
asked Sep 13, 2013 in APACHE by rajesh
edited Sep 12, 2013
0 votes
15 views



Related Hot Questions



Government Jobs Opening


...