Lesson 5 of 9 · 24m
Canonicals, Redirects, and Duplicate Control
How canonical signals combine, why contradictory redirects quietly split authority, and the rules for parameters, trailing slashes, and alternate versions.
Canonicalization sounds like one tag. In production it is a negotiation among redirects, canonical links, internal links, sitemaps, hreflang, parameter behavior, and server configuration. Search engines pick a canonical when those signals agree. When they disagree, they still pick one — just not necessarily the one you wanted.
Choose one URL form and enforce it
Decide whether the canonical form uses a trailing slash, lowercase paths, a specific host, and HTTPS. Then make every other form resolve permanently to it.
server {
listen 80;
server_name sudosecurity.org www.sudosecurity.org;
return 301 https://sudosecurity.org$request_uri;
}At the application edge, normalize casing and trailing slashes consistently. /Learn, /learn/, https://www.sudosecurity.org/learn, and http://sudosecurity.org/learn should not all return 200. Each live variant is a competing duplicate.
rel=canonical is a hint, not a command
<link rel="canonical" href="https://sudosecurity.org/learn/seo-for-developers">A canonical should usually be self-referencing on the preferred page and point to the preferred page on duplicates. It must be absolute, indexable, and consistent with redirects and internal links. Canonicalizing a live page to a URL that redirects elsewhere is a contradiction. So is canonicalizing A to B while every internal link points to A.
Parameters need policy, not hope
Tracking parameters are the obvious case:
/learn/seo-for-developers?utm_source=newsletter&utm_campaign=launchThe canonical should strip utm_*, the internal links should omit it, and the page should not change content based on it. Functional parameters are different. ?page=2 may be meaningful; ?sort=price may be duplicate; ?color=red may or may not deserve indexation. The correct answer comes from search demand and content uniqueness, not a blanket rule.
Redirects consolidate; chains dissipate
Use 301 or 308 for permanent moves. Keep the old URL alive for years, not weeks, because external links and cached references persist. Update internal links to the final target even though the redirect works — every internal hop wastes crawl and slows users.
curl -sI https://sudosecurity.org/old-course | grep -iE 'HTTP/|location'Avoid chains like /old → /older → /new. They are common after migrations because each team appends its own redirect layer. Collapse them to one hop. Test loops, especially when rules differ between the CDN, load balancer, and application.
Duplicates inside templates
Pagination, print views, localized versions, and CMS preview routes can all duplicate content. Some deserve canonical consolidation; some deserve noindex; some deserve deletion. The senior move is to map duplicate classes before choosing a mechanism. Canonical tags are not a substitute for information architecture.
Field notes
- Canonical tags in JavaScript-only rendering are weaker than canonicals in initial HTML.
- Do not canonical paginated pages to page one if deeper pages contain unique items.
- Syndicated content should canonical back to the original when partners cooperate; otherwise expect the stronger site to win.
- Search Console's URL Inspection tool reports both user-declared and Google-selected canonicals. When those differ, believe Google's selection and fix the signal conflict.
Was this lesson helpful?