Skip to content

What Is a Canonical URL and How Does It Affect Domain Choice?

A canonical URL names the preferred address when several URLs show the same page. Learn how it relates to your domain, www, HTTPS, redirects and sitemaps.

9 min readUpdated Nov 28, 2026By XPASS Editorial Team

What Is a Canonical URL and How Does It Affect Domain Choice?

A single web page can often be reached through more than one address. The home page might load at http://example.com, https://example.com, https://www.example.com, and the same address with a slash at the end or a tracking code attached. To a visitor these all look identical. To a search engine they are separate URLs, and it has to decide which one deserves to appear in results. The canonical URL is the answer you give to that question.

This guide explains what a canonical URL is, where duplicate addresses come from, and how your choice of domain, www or non-www, and HTTPS fits into the picture. It then covers how to declare your preferred address, how a canonical tag differs from a redirect, and the mistakes that most often weaken the signal. If you are still deciding whether the site is ready to be found at all, the guide on getting a company website found on Google gives the wider starting point, and if you are planning to change your address, the article on 301 redirects when changing a domain is the natural companion.

What a canonical URL is

The word canonical simply means the standard or preferred form. A canonical URL is the address you want search engines to treat as the main version of a page. When several URLs lead to the same or very similar content, search engines try to group them and pick one representative. That chosen address is what they index, show in results and credit with links.

You do not control the choice completely, but you can influence it strongly. The signals you control include a canonical link element placed in the head section of the page, redirects, the addresses you use in internal links, and the addresses you list in your sitemap. Search engines weigh all of these. When they agree, the outcome is predictable. When they conflict, a search engine may pick an address you did not intend.

The reason this matters is that duplicate addresses divide attention. Links may point to different versions, so their value is split. Reports in your analytics show the same page under several names. The version that appears in search results might be an awkward one with a long parameter string. None of this is a penalty. It is simply inefficiency, and a little care removes it.

Where duplicate addresses come from

Most sites create duplicates without anyone intending to. The usual sources are these.

Source Example of two addresses for the same page
Protocol http://example.com/page and https://example.com/page
www versus non-www https://www.example.com/page and https://example.com/page
Trailing slash https://example.com/page and https://example.com/page/
Letter case https://example.com/Page and https://example.com/page
Index files https://example.com/ and https://example.com/index.html
Tracking parameters https://example.com/page and https://example.com/page?utm_source=news
Sorting and filters https://example.com/shop and https://example.com/shop?sort=price
Printable or mobile versions https://example.com/page and https://example.com/page/print
Several domains https://example.com/page and https://example.net/page

Every one of these can usually be solved with a small number of rules. The first four rows are about your site configuration and are solved once with redirects. The parameter and filter rows are about how your application builds links and are solved with canonical tags and sensible link design.

How the domain, www and HTTPS fit in

The most important canonical decision is the form of your hostname, because it affects every page on the site. You need to choose three things and then stick with them.

First, choose HTTPS. In practice that is the modern default, and it requires a valid certificate for the hostname you pick. The explanation of how encrypted connections work in general is in the Google SEO Starter Guide and in the wider documentation about secure sites. If you do not yet have a certificate that covers your domain, the SSL certificates page explains the options.

Second, choose www or non-www. Both are fine. A www hostname gives a little more flexibility for some hosting and DNS setups, because a subdomain can be pointed with a CNAME record while the bare domain generally cannot use one in the same way. A bare domain is shorter and looks cleaner on cards and signs. Pick the one that suits your setup and brand.

Third, choose one primary domain if you own several. Many businesses register the same name under several endings, such as .com, .net and a country ending, to protect the brand. Only one of them should be the primary address. The others should redirect permanently to it. This is the case where the registration of extra names, which you can arrange through the domains page, supports the brand without creating duplicate sites.

Once the choice is made, the rule is simple: every other form should send visitors and search engines to the chosen form with a permanent redirect, and every place where you write the address should use the chosen form.

How to declare the canonical address

You have four main tools, and they work best together.

1. Permanent redirects for versions that should never be seen

A 301 redirect tells visitors and search engines that the old address has moved permanently. The meaning of the status codes is defined in RFC 9110. Use it for http to https, for www to non-www or the reverse, for removing a trailing slash or adding one consistently, and for secondary domains. Visitors never see the unwanted version, and signals consolidate quickly.

Some addresses must keep working, such as a product page with a tracking parameter from an advertisement, or a filtered list. For these, place a canonical link element in the head section of the page. It has a rel attribute with the value canonical and an href attribute with the full preferred address. Search engines treat it as a strong hint that the page is a duplicate of the address you named.

If your own menus, buttons and article links use the non-preferred form, you are sending contradictory signals. Make sure internal links point to the canonical address exactly: same protocol, same hostname, same trailing-slash style.

4. A sitemap that lists only canonical addresses

A sitemap is a list of the addresses you want indexed. It should contain only canonical versions, only pages that return a successful response, and not addresses that redirect. The format is described in the sitemaps protocol.

Step by step: setting up your canonical address

  1. Decide the preferred form: https, with or without www, one primary domain.
  2. Confirm that a valid certificate covers the preferred hostname and, if you redirect from the other hostname, that visitors reaching the other hostname also see a valid certificate so the redirect does not show a warning.
  3. Add redirects: http to https; the non-preferred hostname to the preferred one; secondary domains to the primary. Use 301 and send each address to its exact equivalent, not to the home page.
  4. Decide your trailing-slash and letter-case rules and redirect the variants.
  5. Add a self-referencing canonical element to each page, with an absolute address that matches the final preferred form.
  6. For parameter pages, such as tracking codes and sort orders, point the canonical element at the clean address.
  7. Update internal links, the sitemap and any structured data to use the preferred form.
  8. Register the preferred version in Google Search Console, and check the coverage and indexing reports after a few days for pages that Google chose to treat differently.
  9. Test with a few real addresses: type each variant in a browser, or use a command line tool that prints headers, and confirm that you reach the preferred address with a single permanent redirect.

A plain example

Suppose a small accounting firm owns example.com and example.net. The site runs at https://www.example.com. A few months after launch, the owner notices in Search Console that the same pages appear under http, under the bare domain, and with parameters from an email newsletter.

The fix is a short list. The owner decides that the primary address is https://www.example.com. The hosting settings are changed so that http redirects to https and the bare domain redirects to the www form, with a single hop. The secondary domain example.net is pointed to the primary with a permanent redirect that keeps the path. Every page gets a canonical element naming its own clean address, including the pages that receive newsletter parameters. The sitemap is regenerated so it lists only the final addresses. Internal links in the menu, which had been written without www, are corrected.

A few weeks later the reports show the clean addresses being indexed, and links that people had shared in different forms all lead to the same place. Nothing dramatic happened to the ranking, but the site stopped splitting its signals.

Canonical tag or redirect: which to use

Situation Better tool
http and https 301 redirect
www and non-www 301 redirect
Old domain replaced by a new one 301 redirect
Tracking parameters on an advertisement link Canonical element
Sorted or filtered list pages Canonical element, plus careful link design
Syndicated article on a partner site Cross-domain canonical element, if the partner agrees
Page that was removed with no replacement Neither: return a not-found or gone response

The simple rule: if nobody should ever need the other address, redirect. If the other address must keep working for a reason, use a canonical element.

Limits and what to watch for

  • A canonical element is a hint, not an order. If redirects, internal links and the sitemap disagree with it, a search engine may ignore it.
  • Do not point the canonical element of many different pages at the home page. Search engines will usually see this as a mistake and ignore it, and you lose the pages' individual visibility.
  • Do not combine contradictory signals, such as a canonical element naming one address while the sitemap lists another, or a page that is blocked from crawling yet has a canonical element that search engines are expected to read.
  • Avoid redirect chains. If http goes to https, then to www, then to a trailing-slash form, each hop adds delay and risk. Aim for a single step.
  • Use absolute addresses in canonical elements, including the protocol and hostname, rather than relative paths that can be misread.
  • Keep the certificate current. An expired or mismatched certificate on any hostname that redirects can break the redirect for visitors.
  • Do not use a canonical element to merge pages with genuinely different content. It is for duplicates and near duplicates, not for hiding thin pages.
  • When you change domain, the canonical element, redirects, internal links and sitemap all need to change together. The article on keeping your SEO ranking when you change domain walks through that process.
  • If you run business email on the domain, redirect rules for web traffic do not affect mail, but DNS edits do. Review the mail records before changing DNS, and see the business email page if you are setting mail up for the same name.

Summary

A canonical URL is the preferred address for a page, and choosing it well is mostly a matter of consistency. Pick one form of your domain: https, with or without www, and one primary domain if you own several. Send every other form to it with a permanent redirect, use canonical elements for the variants that must stay reachable, keep internal links and sitemaps consistent, and cover the chosen hostname with a valid certificate. Treat the canonical element as a strong hint rather than a command, and check the result in Search Console after a few weeks.

If you are still choosing or consolidating the names for your site, the domains page is a sensible place to look.

Frequently asked questions

What is a canonical URL?

It is the address you want search engines to treat as the main version of a page when the same or very similar content can be reached through several addresses. You signal it with a canonical link element in the page head, redirects, and consistent internal links and sitemaps.

Is the canonical tag a command or a hint?

It is a strong hint, not a command. Search engines usually follow it when your other signals agree, but they may choose a different address if redirects, internal links and sitemaps point somewhere else.

Should I use a canonical tag or a 301 redirect?

Use a 301 redirect when visitors should never see the other address, such as http versus https or www versus non-www. Use a canonical tag when both addresses must stay reachable, such as a page with tracking parameters or a printable version.

Does it matter if I choose www or non-www?

Either works. What matters is choosing one, redirecting the other to it permanently, and using it everywhere: in canonical tags, internal links, sitemaps and your certificate.

Can a canonical tag point to a different domain?

Yes, a cross-domain canonical is allowed, for example when content is syndicated on a partner site. It is a hint, so use it carefully and only when the pages are really the same content.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Start your website the right way

Register a domain, add SSL and set up business email from one place.

.com registration from $18.81 for the first year

Start with a domain

Keep reading

Website Guides

What Is a 301 Redirect and How to Use It When Changing Domain

A 301 redirect is a permanent forwarding rule. This guide shows how to use it when you change domain: map old URLs, set rules, test them and avoid common mistakes.

9 min read

Website Guides

How to Get a Company Website Found on Google: Where to Start

A step-by-step starting point for making a company website easy for Google to find: domain, HTTPS, indexing, sitemap, content and measurement.

10 min read

Website Guides

How to Change Your Domain and Keep Your SEO Ranking

A domain change can hurt search visibility if done carelessly. Follow a step-by-step plan with redirects, canonical tags, sitemaps and monitoring.

10 min read