Our preferred 301 redirect string for multiple domain names and www preference settings is included in this post! This is a usable tip! We would love to hear your comments!
SEO needs to walk a fine line to avoid black hat practices and page duplication on the web for each website, and even settings in your server can get you black listed. This is especially true if you have more than one domain name. Google recommends a 301 Redirect in your .htaccess file, which is the file for permanent redirect. Let me explain.
When you set up your website, you have the option to check the www, for the preferred domain type, over the non www. Google recognizes through historical settings, that the www is the primary domain, and without the redirect, the non www shows up when you type it in that way. This is fixed by adding a .htaccess (UTF-8 type file) to your to your web site directory. This .htaccess file needs to be added by your server administrator in most cases. It is unrecognizable by most ftp client programs that I have seen.
The 301 redirect string is added in your web site htaccess file to direct it to the www. in this example, to make sure search engines know there is only one website, so it does not come up two different ways. This will prevent the splitting your page rank, and also prevent the potential for duplicate pages, which search engines do not like! This is a search engine black list type action! This can get you banned from Google and Yahoo, especially if you have a lot of domain names.
This .htaccess file is always checked first, and directs traffic to page names or primary pages upon your command, as well as having a place for other codes that are useful, and where pages should be found or blocked. What is the difference with the www and non www, and what is a root domain?
The www, or anything before the dot on the domain name is called a sub domain name, is recognized as another website, and has separate page rank. www.seodomainnames.com is a subdomain of the “root domain name” seodomainnames.com. Because of the lack of redirects being used correctly over the years, google has historically preferred the www version. Google recognizes the non-www as a separate domain, so will have the tendency to delete that version from search if conflicting pages arise. The www is preferred at this point until we hear differently in SEO practices. Most of the top websites resolve to the www version. 4
To note, the non-www is known as the root domain, in it’s purest form. With the www being preferred at this point, we choose that method. This can be seen by typing seodomainnames.com in your address bar, and seeing the www appear. That is the result, grouping all direction to one specific location. Google, Yahoo, MSN, all use the 301 Redirect command string, with a simple exercise of typing all of those in your address bar and seeing the www appear when the page appears.
With Google Account settings that can assist in this identification, there is also a setting in Google that can directly tell them that the primary domain is www, and that setting is also recommended to make it as search friendly as possible.
Correct uses of Multiple Domains.
Multiple generic domain names can get you in trouble easily if not correctly used. With aliases as they are called, they can be added in your server to go to your main page. We have www.SEODomainNames.com, and choose to have semfirm.net as another. When you add that domain name without any redirects, then you can type in semfirm.net and it will show SEODomainNames.com but the browser shows semfirm. What you have done in this instance is added the second domain name and have not added a redirect.
Keep it clean, control multiple content with a 301 redirect to your www or non www version, and add all domain names as domain aliases. This will help tremendously.
The code we use in our .htaccess file is as follows. This functions very well in our Linux server, as we also have script included to help our wordpress generate pretty urls, as well as additional script that makes our php functions work really well.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
RewriteRule ^(.*) http://www.mydomain.com/$1 [L,R=301]
Replace mydomain with your domain name, and change the com or net to your website name TLD. Be careful not to change any of the other code, including any dots or slashes.
Your website host will need to perform this function. Add the code mentioned above to a file in your root directory named .htaccess, and make sure the dot is in front of this file name. Save it in UTF-8 encoding, then when you type in mydomain.com it will resolve to www.mydomain,com.
This prevents a page duplicate to your entire website, when it resolves to the two different forms, it shows two pages that have the same content on them, or duplicate content. From there, add extra domain names as domain aliases and they will all resolve to the one www version you have chosen.
If this string does not work, check with your website host and ask them what string you can use to get the redirect to function. Again type in the non www version to see if the www appears. Try SEODomainNames.com without the www, then try SEMFirm.net. See how it too resolves to the www of Seo Domain Names. This is all set up correctly as an example.
Good Luck in your quest for the perfect SEO website, and enjoy your website experience, and success!
Great information! I’ve been looking for something like this for a while now. Thanks!
Great site. A lot of useful information here. I’m sending it to some friends!
Very good and interesting post.
Loved your article, best information that i have found on the redirect.
Thanks so much.