Short answer: canonical URLs and duplicate URLs come down to one rule: pick one URL form for every page, enforce it with a single 301 redirect that keeps the path and query, and make internal links, the canonical tag and the sitemap all agree with it. A page reachable at two addresses competes with itself: the signals it earns are split between the twins, and nothing reports an error. Fix it before you publish more pages, because the cost grows with the site.

This applies to AI answers as much as to search results. Answer engines fetch and cite URLs, and if you measure citations per URL, twins split those counts too. A page that is cited under two addresses looks like two weaker pages in every report you build on top of it.

What duplicate URLs actually cost us

We ran this experiment on ourselves without meaning to. A trailing-slash inconsistency on insightwonder.com left 46 pages indexed under two URLs each, and 1,980 impressions were split between the twins in our Search Console export covering 2026-07-02 to 2026-09-07. Each version was evaluated and reported separately, so neither accumulated the signal the page had actually earned.

Before: two addresses, both 200What the page earnsimpressions, links, citations/guide200, part of the signal/guide/200, part of the signalAfter: one addressWhat the page earnsimpressions, links, citations/guide301 redirect/guide/200, all of the signalOn insightwonder.com a trailing-slash inconsistency left 46 pages indexed under two URLs each,splitting 1,980 impressions between the twins (Search Console, 2026-07-02 to 2026-09-07).
Figure 1. A page reachable at two addresses splits what it earns; one permanent redirect consolidates it. Source: insightwonder.com Search Console export for 2026-07-02 to 2026-09-07, exported 2026-09-09.
Nothing errors. The build passes, the pages render, analytics looks normal. The only symptom is a plateau you cannot explain.

That is why duplication is easy to miss and worth looking for deliberately. The fix is usually a routing change; the expensive part is how long a split index takes to settle afterwards. It is also why the problem tends to be found late: by the time a plateau is noticed, the site has often grown, and every new page has been published into the same split.

The forms that duplicate

Almost every duplicate is one of a handful of pairs. Each has a usual cause and a usual fix, and the fix is nearly always at the server or framework rather than page by page:

PairUsual causeUsual fix
/page and /page/The framework default disagrees with internal links or the sitemapSet the framework's trailing-slash option and redirect the other form
www and the bare domainNo redirect at the server; both answer with 200One host-level 301 to the chosen host
http and httpsAn incomplete redirect after a certificate or hosting changeRedirect every http request, not only the homepage
Query-string variantsTracking, sort or filter parameters that are neither stripped nor canonicalisedCanonical to the clean URL; keep parameters out of internal links
Uppercase and lowercase pathsA case-insensitive server serving case-sensitive linksLowercase links at generation, redirect mixed case
A staging or platform subdomainA copy of the site on a preview host that is open to crawlersBlock indexing on the preview host; never link to it

Parameter variants deserve a separate word, because they multiply. A single listing page with three sort orders and a tracking tag on campaign links can produce a dozen addresses for the same content, and none of them is wrong on its own. The defence is to keep parameters out of the links you generate, and to make the clean URL the canonical on every variant.

Find your duplicate URLs

Start with data you already have. In Search Console's pages report, look for pairs that differ only by a slash, host, case or parameter; both appearing with impressions is the clearest sign. Then check how each variant actually responds, rather than trusting the configuration:

for u in https://example.com/guide https://example.com/guide/ \
         https://www.example.com/guide/ http://example.com/guide/; do
  echo "== $u"
  curl -sI "$u" | grep -iE '^(HTTP|location)'
done
curl -s https://example.com/guide/ | grep -io '<link[^>]*rel="canonical"[^>]*>'

Every variant except the chosen one should answer with a single 301 redirect whose location is the chosen form. The chosen form should answer with 200 and a canonical tag pointing at itself.

What a correct setup returnsPatterns to fixhttp://example.com/guide/301 redirect, one hop, to https://example.com/guide/https://www.example.com/guide/301 redirect, one hop, to https://example.com/guide/https://example.com/guide301 redirect, one hop, to https://example.com/guide/https://example.com/guide/200 response, canonical tag pointing at itselfRedirect chain301 then 301 then 200: collapse to one hop302 redirectsays the move is temporary200 response on two variantsthe twins themselvesEvery old URL to the homepagesoft 404s: worse than the duplicate
Figure 2. The responses to expect from each URL variant when the setup is correct, and four patterns to fix. Source: the curl check in this section, using HTTP status semantics.

A chain of several redirects, a temporary 302 redirect, or a 200 on more than one variant are all things to fix. So is the opposite mistake: a redirect that sends every deep URL to the homepage. It answers 200 for content that does not exist there, which turns real pages into soft 404s and is worse than the duplicate you were fixing. Finally, compare the URL form in your sitemap with the form your internal links use. If they disagree, you have found the source of the twins before any crawler did.

Fix it in the right order

  1. Decide the form and enforce it in code, so every generated link, the canonical tag and the sitemap agree by construction rather than by discipline.
  2. Redirect every other variant with a single 301 redirect that preserves path and query. A 308 redirect is also permanent and keeps the request method; either works for pages. A 302 or 307 says the move is temporary, which is the opposite of what you mean.
  3. Point the canonical tag at the enforced form, as an absolute URL, on every page including the canonical page itself.
  4. List only the enforced form in the sitemap, then resubmit it so recrawling starts sooner.
  5. Watch the twins in Search Console until the non-canonical versions stop collecting impressions. We cannot give you a reliable timeline for this; read it from your own data.

At the server, the redirects are a few lines. For nginx, for example:

# www to apex, keeping path and query
server {
  server_name www.example.com;
  rewrite ^ https://example.com$request_uri? permanent;
}

# add the trailing slash to paths without a file extension
rewrite ^([^.]*[^/])$ $1/ permanent;

Test the result with the loop above before and after deploying, including a URL with a query string.

The canonical tag is a hint, not an instruction

A canonical tag that points one way while internal links, the sitemap and the redirects point another is a contradiction, and a contradiction is resolved by the crawler rather than by you. The tag works when everything else already agrees with it. That makes it the last step, not the fix.

The chosen URLhttps://example.com/guide/Redirectsevery variant, one 301 hopInternal linksgenerated in this formSitemaplists only this formCanonical taga hint: works when the rest agreeCitation countsnormalised to this formWhen the inputs disagree, the crawler picks. When they agree, the canonical tag just confirms it.
Figure 3. Every signal has to point at the same URL. The canonical tag is the weakest of the five on its own. Diagram, not measured data.

A few rules keep the tag from contradicting itself. Use one canonical per page, in the head, as an absolute URL. Never point it at a URL that redirects, returns an error or carries noindex, because each of those sends two opposite messages at once. And if a page must not be indexed at all, a canonical tag is the wrong tool; that is a job for noindex, covered in meta robots and X-Robots-Tag.

The order matters more on a large site than a small one. On a small site the fix is one routing change. On a large one it is the same routing change plus a much larger backlog of split URLs to wait out, so if you plan to grow the page count, close this first. The broader checklist of access issues worth clearing at the same time is in the technical access reference.

Platform specifics that create or hide duplicates

  • Shopify generates the sitemap itself and documents no supported way to customise it or exclude individual URLs, according to its sitemap help page. Its default robots.txt already disallows /search and filtered collection URLs, which keeps those parameter variants out of the crawl without any work on your part. If you edit robots.txt.liquid, add to the defaults rather than replacing them, or those protections go with them.
  • WordPress has generated a sitemap at /wp-sitemap.xml since version 5.5, and most SEO plugins replace it with their own at a different URL, so two sitemaps often coexist (WordPress core announcement). Make sure only one is advertised and that both list the same URL form.
  • Webflow includes every live page in its generated sitemap unless that page's sitemap toggle is off, and you can paste a hand-written sitemap instead, but not both, or robots.txt ends up advertising two (Webflow help). The webflow.io staging subdomain is a second host for the whole site, so audit on the custom domain.
  • HubSpot system domains containing hs-sites are permanently no-index. Removing a URL from the HubSpot sitemap does not deindex it, and landing pages are not added to the sitemap automatically (HubSpot knowledge base).

More on how sitemaps feed both search and AI crawlers is in sitemaps and AI search.

Count citations on the canonical URL

If you track which of your pages AI answers cite, normalise every cited URL to its canonical form before counting: strip tracking parameters, settle the slash, the host and the protocol. Otherwise a page cited under two addresses looks like two weaker pages, and a fix that consolidates them looks like a drop for one of them.

The same applies to breadth. The number of distinct questions that cite a page is a better measure than the raw count, and it is only meaningful when the page has one identity. Do the normalisation in the counting step, not by editing stored answers, so the original evidence stays intact. Citation analysis covers the rest of the counting rules.

Sources