Using Permanent Redirects for Canonical URLs
What are Canonical URLs?
The preferred address of a domain, which can be two different URLs. Although, both can be used to access the same domain/website, shown in the below example; www.yoursite.com or yoursite.com
Follow the simple example below to redirect canonical URLs on your domain. Setting a 301 (permanent) redirect from yoursite.com to www.yoursite.com.
To take advantage of 301 redirects you will need FTP or control panel access to your website. If you do not have this information you can get it from your web hosting provider.
Word of warning, you will have to edit your .htaccess file to accomplish this. Please be careful and always make a backup of the original just in case there is a problem.
Using 301 Permanent Redirects
First, open your .htaccess file with a plain text editor such as notepad. Next copy and paste the following code into the .htaccess file;
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite\.com$ [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]
Next, simply replace “yoursite” with your unique URL, save and upload. Now when somebody types in yoursite.com in their browser they will be automatically redirected to www.yoursite.com.










