Single Blog

Boost your SEO with Canonical URLs

1 June, 2017, Written by 0 comment

Most website owners would know that getting your site ranked well in Google is a key ingredient of online success. The two components of your site ranking are “off-site” SEO factors and “on-site SEO”. This article will talk about a couple of important techniques to boost your “on-site” search engine optimization; canonical URLs and 301 redirects.

Canonical URL’s.

Webster’s dictionary defines “canon” to mean: the body of rules, principles, or standards accepted as axiomatic and universally binding in a field of study or art.”  How does this apply to your website? Well if you try to access any given page of your website in the browser you might be able to successfully do so with some or all of the following URLs.

http://mywebsite.com/widgets/

http://www.mywebsite.com/widgets/

https://www.mywebsite.com/widgets/

https://www.mywebsite.com?q=widgets

How does Google know which one of these is the preferred page for listing in it’s search results? Short answer – it doesn’t. That’s why you have to tell them using the canonical url tag in your web page <head> section.

<link rel="canonical" href="http://www.mywebsite.com/widgets">

Google will now consolidate all your incoming “link juice” on your preferred page option.

If you are running a WordPress site then the good news is that everybody’s favorite SEO plugin, “Yoast SEO” makes it easy for you to set up.

 

To 301 or not to 301

Google respects the rel=”canonical” link, but what about all the other search engines out there in the internet wilderness?

A more robust way of ensuring all search-bots use a single url is to add some code to your .htaccess file in the root of your public server directory that looks like this:

# Ensure www on all URLs for consistency 
RewriteCond %{HTTP_HOST} ^example.com [NC] 
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] 
# Ensure we are using HTTPS version of the site if you have an SSL certificate
RewriteCond %{HTTPS} !on 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
# Ensure all URLs have a trailing slash for consistency 
RewriteBase / 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} !(.*)/$ 
RewriteRule ^(.*)$ http://www.example.com/$1/ [L,R=301]

If you are not familiar with editing your .htaccess file be sure to ask your hosting provider to give you a hand. They should be willing to help out and roll back any changes if there are problems.

Keep in mind though, that not all CMS systems might allow for this. If adding 301 redirects to your site causes technical issues with your site, you would be best advised to settling with the canonical link technique described above.

Summary

By using the link rel=”canonical” directive and .htaccess 301 code snippets correctly, you can substantially focus the incoming link SEO benefits to your site. Rather than spraying the “google juice” like a garden sprinkler across multiple urls, you will be able to concentrate the benefit on your preferred URL like a fire hose.

Use rel=canonical and 301 redirects to stop spraying your SEO benefits across multiple URLs.

 

Website Admin