Select Page

www-or-non-www-canonical-problem

Rating: +0

Positive Negative

The reason it's may be a "problem" is because the search engines see subdomains as separate domains, and the www is no exception.

Therefore, you run the risk of aparrently having duplicate pages in two separate areas of your website. This is called a "canonical" issue, and there is a fix...

To avoid a possible duplicate content penalty, and to ensure that you have the same PageRank on both versions, I prefer to force all non-www. requests to 301 (permanently) redirect to the www version.

By doing a 301 instead of a 302 or other redirection method, you retain all inbound link value and PageRank. (However, PR may have to run through an update cycle before you can see it in the toolbar)

Built inside Google's Webmaster tools is a tool so that you can tell Google manually which version you prefer it to use.
Simply log in, and go to tools - set preferred domains - and from there. You just checked the box and hit okay.

That fix takes awhile to kick in with Google, and it really doesn't do anything for the other engines or for your visitors, who still see both URLs.

I manually edit my .htaccess file in the root of my domain to include these lines to force a 301 redirect.

Here it is - (make sure you change the domain name!)

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^pdxtc.com [NC]
RewriteRule ^(.*)$ http://www.pdxtc.com/$1 [L,R=301]

Always make a backup of your htaccess before editing, just to be safe.

This is of course assuming you are on an an Apache server that supports mod rewrite, which most do.

If you are on a Windows server, that's a different can of worms, and this fix won't work, but the principle is the same. If anyone needs a Windows answer, just comment here...

If you like what you've seen here, would you please share this?