What is a canonical redirect? For my web site the Canonical URL is http://webdesign-ri.com and this is the primary address for my domain and the address http://www.webdesign-ri.com is considered a different address unless we instruct the server to ‘join-the-dots’ and this process is called a canonical redirect. We use what is called a permanent 301 redirect a method of pointing www.webdesign-ri.com to webdesign-ri.com ( and all pages on the site) such that it is transparent to the user. To see it in action type in www.webdesign-ri.com and you will see webdesign-ri.com appear in the address bar.

To execute a canonical redirect on an Apache server, we must add  a little  code to the .htaccess file. The code below is the actual code from my .htaccess file, to adapt this for your web site simply swap out my domain for yours.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^webdesign-ri.com
RewriteRule (.*) http://webdesign-ri.com/$1

[R=301,L]