qp
Joined: 08 Sep 2009 Posts: 24
 |
Posted: Sun Feb 07, 2010 9:09 pm Post subject: Rewriting of URLs to www subdomain with 301 redirect |
 |
|
I think for SEO reasons or just neatness, it is good to have different ServerAlias domains to 301 redirect to a canonical domain e.g. one with a www. prefix. Something like this:
RewriteEngine On
RewriteCond %{HTTP_HOST} !www.mydomain.com$
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
So if someone enters http://mydomain.com/ in the browser, not only will it go to the website, but also the URL gets rewritten as http://www.mydomain.com/
And search engines know to combine links for both URLs into one record so you get one PageRank for both rather than one each.
I might have missed it, but maybe DTC could do this, either by default with an option to disable, or as a non-default option. I think there is a slight overhead, but not much. |
|