Free Search Engine Visibility Report

Newsletter Sign Up

First Name:

Last Name:

Email:

 

SEO Client
Results

Don't take our word for it, see our SEO results for yourself. When selecting a SEO firm make sure to ask for examples of their rankings. We only employ ethical SEO practices (white hat SEO practices) to achieve the best results for our clients.

View Results »

Domain Name Canonicalization and the .htaccess File

http://www.morevisibility.com/seoblog/domain-name-canonicalization-and-the-htaccess-file.html December 17th, 2009 by

The .htaccess file is the main configuration file for URL Rewriting software, such as Apache’s mod_rewrite and Helicon’s ISAPI_Rewrite. An .htaccess file can be used to perform many different SEO-related tasks. Whether or not your web host allows the use of the .htaccess file can mean all the difference in the world when planning an SEO strategy for your website. In all of our client projects, we use the .htaccess file to perform some SEO-critical functions. One of the most important functions that the .htaccess file can perform is domain name canonicalization.

Domain Name Canonicalization

If a domain name is not canonicalized, it means that the same site will be presented to the browser when different combinations of a domain are requested. For example, consider the following urls:

http://www.domain.com
http://domain.com

While both of the examples above look the same, they are in fact quite different. Search engines may regard them as different URLs altogether. As a result, some pages may get indexed under the www version, while others may get indexed under the non-www version. One way to ensure that search engines will only index one version is by adding the following rule into your .htaccess file:

RewriteCond  %{HTTP:Host} ^domain\.com$
RewriteRule  (.*)  
http://www.domain.com/$1 [QSA]

With that rule in place, when the non-www version of the site is requested, the user will be redirected to the canonicalized www version. It should be noted that this rule will not just work for the homepage, but all pages within that domain. For example:

domain.com/page1.htm

… will redirect to this…

http://www.domain.com/page1.htm

As you can see, that rule is pretty powerful. In a future post, I will demonstrate how the .htaccess file can be used for page level redirects.

Posted in SEO & Web Development

Comments are closed at this time.


Subscribe rss feed Login or Register

Recent Articles

Article Categories

Articles by Month

Related Sites


Inc 5000 Google Analytics Authorized Consultant Google Qualified Company Microsoft adExcellence Member Greenified 2009

MoreVisibility
925 South Federal Highway, Suite 750
Boca Raton, FL 33432 www.morevisibility.com

800.787.0497

ph: 561.620.9682

fx:  561.620.9684


© 1999 - 2012 MoreVisibility ® All Rights Reserved. Privacy | Legal

MoreVisibility Social Networking Links Google+ YouTube LinkedIn Facebook Twitter