Canonical URL
Definition
The same file being reachable at more than one URL is normal rather than exceptional. A single page can answer at http and https, with and without www, with and without a trailing slash, at the directory and at 'index.html' directly, and at every combination of tracking parameters a campaign appends. To a crawler those are separate addresses that happen to return identical content, which splits links and signals across all of them and leaves the engine guessing which to show. The canonical tag settles it. Every page should carry one, including the preferred version itself — a self-referencing canonical, pointing at its own address, is the normal case and not a redundancy. Important caveat: a canonical is a hint, not an instruction. A search engine weighs it against sitemaps, internal links and redirects, and can decide otherwise.
Why It Matters
Consider a page reachable at five variants that has collected forty inbound links, spread eight per variant. Without a canonical, no single address looks particularly authoritative and the engine picks one for you — often the one with a tracking parameter attached, which is then what appears in search results. Declare the canonical and all forty links count towards the one address you chose. Duplication also wastes crawl budget, since the same content gets fetched repeatedly under different names instead of your other pages being discovered. For a small site the cost is mild; for a few hundred pages with parameters it is the difference between being indexed and not.
How It Works
Put a link element in the head with rel=canonical and an absolute href, protocol and host included — a relative value is a frequent source of trouble. For files that have no head to put it in, such as a PDF or an image, the same declaration can travel as a Link HTTP response header with rel=canonical. Keep the value consistent across every variant: all five addresses should name the identical canonical, character for character, since a trailing slash makes it a different URL. The canonical does not stop anyone reaching the other addresses, which is the difference between it and a 301 redirect — a redirect removes the duplicate, a canonical tolerates it and names a preferred version. Reinforce the same choice in your 'sitemap.xml', listing only canonical addresses, and by linking internally to those and no others.
Real-World Example
A consultancy publishes a report on 99helpers at market-review.99helpers.site and shares it in three places, each with its own tracking parameter, while the page also answers at the bare address and at its 'index.html'. Adding a self-referencing canonical pointing at the clean address means the five variants consolidate into one indexed page. The share links keep working and analytics still records which campaign brought each visitor.
Common Mistakes
- ✕Pointing every page's canonical at the home page — the engine is told the individual pages are duplicates of it and drops them from the index
- ✕Using a relative href, or one whose trailing slash or protocol differs from the address you actually want indexed
- ✕Leaving a staging address in the canonical after going live, which nominates a page nobody can reach
- ✕Treating the tag as binding — it is a strong hint, and contradicting it with internal links or redirects invites the engine to overrule it
Related Terms
301 Redirect
A 301 redirect is a response telling the browser that a page has moved permanently and giving the new address. The old URL keeps working for anyone who follows the old link, but everything that matters now lives at the new one.
HTTP Status Code
An HTTP status code is the three-digit number a server returns at the head of every response, saying what happened to the request. It is the first thing on the first line — a 200 means here is the file, a 404 means there is nothing at that address.
index.html
index.html is the file a web server returns when a visitor asks for a folder rather than a named file. It is the default document for the site root and for every directory inside it.
sitemap.xml
An XML file listing the pages of a site so search engines do not have to find them all by following links. It aids discovery; it does not affect ranking.
Apex Domain
The apex domain is the bare name with nothing in front of it — acme.com rather than www.acme.com. It is also called the root domain, the naked domain or the zone apex.
Put a file online in seconds
Drop in a document, an image, a page or a whole static website and share the link — free, with no build step and no server to set up.
Host a file free →