First of all, canonical URL errors aren’t really errors. They’re more of a misunderstanding.
You see, Google and other search engines hate duplicated content. Why? Well, Google wants to give people who search the best possible results, and that means each page of results should show 10 completely different results.
The problem is that your webserver and your content management system might automatically duplicate content. For example, your webserver is probably setup to work with or without www before your site name—such as http://www.tips4pc.com and http://tips4pc.com.
It’s possible to make the www version of your site completely different from the non-www version of your site, so Google and other search engines have to scan both versions. And if they find the same content on both sites, they have to assume it’s duplicated content.
But Google and other search engines don’t want to penalize you for kindly creating a www alias of your website, so they give you canonical URL errors to tell you that there’s no official (canonical) version of URLs on your site. That gives you a chance to create that canonical version. Here’s how you do it.
Fixing Domain Name Canonical URL Errors
The biggest canonical URL error for most sites is the www version of a site versus the non-www version.
It may sound odd, but the Internet existed for over two decades before the Web. The Internet is a collection of connected computers—including email servers and database servers—but the Web is a collection of interlinked HTML pages.
Back when Web servers were new, some people wanted to separate them from their other servers, so they put them on a sub-domain, www (for World Wide Web).
Of course, the Web became popular—and people got lazy—so webmasters started making sure people didn’t have to type www anymore. But by that time, some people and some Web browsers were in the habit of typing www before every website, so it became common practice to run all websites with and without the www prefix.
Nowadays, when you buy a domain name from a major registrar, they automatically setup the www and non-www versions of your domain name. And if you use popular hosting for WordPress or other major content management systems, they automatically make sure your software runs under your domain and www sub-domain. All you need to do is tell Google (and other search engines) whether you want www or non-www to be your official (canonical) domain name.
First, check to see if you need to do any configuration. Some top website hosting providers automatically redirect visitors from the www sub-domain of your site to the non-www regular domain of your site. Test your configuration by typing in www.example.com (replace example.com with your site name). If the www disappears from your web browser and your site appears, try one more test. Go to any page on your site besides the main page and then add a “www.” before the beginning of your domain. Press enter. If your Web browser reloads the same page, your Web server is correctly configured.
If your Web server isn’t correctly configured for canonical www domain names, then you will need to configure it using a redirect rule. I don’t recommend that you do this yourself—you could break your entire website. Instead, submit a support ticket and tell them the following:
I want an .htaccess file to define the canonical URL for my site. I want the WWW sub-domain to redirect with an HTTP 301 (permanently moved) status to the non-www domain of my site. For example: www.example.com should point to example.com and www.example.com/page1 should point to example.com/page1.
I read on the Internet that you need to use the Apache module RewriteEngine (or a related tool for other Web servers) to accomplish this.
Replace the www.example.com examples with your own domain name and make sure you thank them for their help before you submit the support ticket.
Canonical URL Errors On Pages
After you fix your www problems, you want to deal with your content management system. Good content management systems, such as the latest version of WordPress, shouldn’t have any real canonical URL errors if you use them in a typical way.
But if you don’t use WordPress, Drupal, or other mature software, you may have a problem with parameters. Parameters are the URL arguments which follow a question mark or ampersand in a URL. To see an example, go to Google Search, type in “example”, and press enter. (You have to press enter to get past the autosearch.)
Look at the Google URL. It should be https://google.com/?q=example. (There may be other things in the URL too.) If you add a new argument, it probably won’t break the search. For example, add &testing=123. Google will still display the same page.
If you use a dynamic content management system, your site probably does the same thing. You can access the same page on your site using different URLs. You know they’re the same page, but Google doesn’t know that, so it assumes you have duplicated content on your site. It is the same with the replytocom errors.
To fix link-based canonical URL errors, I highly recommend that you use WordPress, or that you find out why your WordPress isn’t working correctly. (Are you using some strange plugin?)
But if you can’t get better software, you may be able to fix the software you have. You need to tell your software to add a canonical reference link to every page on your site.
First, see if you already have these links. Go to an article on your site (not your home page) and use your Web browser to view the HTML source. Look in the section for an item which says:
Canonical URL Errors – What Are They And How Do I Fix Them?
Replace example.com with your site name. I just checked and Tips4PC’s articles do this correctly, so you can use them as a reference.
Practically every page (except, in some cases, your homepage) on your site should have a with rel=canonical. WordPress does this for you, as does most other mature content management software, which is why I recommend that you use them. With good software, you won’t need to worry about canonical URL errors.
More Social articles from Business 2 Community: