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.
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:
| Pair | Usual cause | Usual fix |
|---|---|---|
/page and /page/ | The framework default disagrees with internal links or the sitemap | Set the framework's trailing-slash option and redirect the other form |
www and the bare domain | No redirect at the server; both answer with 200 | One host-level 301 to the chosen host |
http and https | An incomplete redirect after a certificate or hosting change | Redirect every http request, not only the homepage |
| Query-string variants | Tracking, sort or filter parameters that are neither stripped nor canonicalised | Canonical to the clean URL; keep parameters out of internal links |
| Uppercase and lowercase paths | A case-insensitive server serving case-sensitive links | Lowercase links at generation, redirect mixed case |
| A staging or platform subdomain | A copy of the site on a preview host that is open to crawlers | Block 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.
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
- 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.
- 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.
- Point the canonical tag at the enforced form, as an absolute URL, on every page including the canonical page itself.
- List only the enforced form in the sitemap, then resubmit it so recrawling starts sooner.
- 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.
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
/searchand 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.xmlsince 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
- Shopify Help Center: find your sitemap
- Shopify: robots.txt.liquid
- WordPress: new XML sitemaps functionality in WordPress 5.5
- Webflow: create a sitemap
- HubSpot: view and edit a HubSpot-hosted domain sitemap
- The duplicate-URL figures are from insightwonder.com's own Search Console export (2026-07-02 to 2026-09-07), exported on 2026-09-09.