301 vs 302 Redirects: When to Use Each and Mistakes to Avoid
301 redirect or 302? The difference, how Google treats each, Apache and nginx code, a redirect map and the mistakes that cost you traffic.
Key takeaways
A canonical tag is a signal that tells Google which URL you consider the main version when the same or very similar content appears at several addresses. You declare it with rel="canonical" in the page <head> or in an HTTP header, and redirects and sitemaps send related signals. Google treats the tag as a strong signal rather than a command, and it makes the final decision on which address appears in results.
Duplicates appear almost without you noticing: the same page with and without www, with ?utm_source=, with a different sort order, in a print version or inside several categories. Without guidance, Google picks a version on its own, and its pick may not be the one you want. This guide covers how Google judges duplicates, when to use the canonical tag, what the code looks like, what happens in online stores and how to check the result. It is a central piece of technical SEO.
Duplicate content is identical or substantially similar text reachable at more than one URL, within one site or across sites. The usual causes are technical, not deliberate:
http and https, www and non-www, trailing slash or none;?utm_medium=, ?sort=price);Contrary to a popular belief, Google does not run a “duplicate content penalty” in normal cases; its documentation says some duplicate content on a site is normal and not a spam policy violation. It clusters similar pages, picks a representative one and shows it. Action is reserved for duplication done to deceive, not a page reachable through three addresses.
The real problems are different:
Do not confuse a technical duplicate with keyword cannibalization: there the pages are different, but they compete for the same search.
Google accepts several ways of saying which address you prefer, with different strength, according to its documentation:
| Method | How to set it | Strength |
|---|---|---|
| Permanent redirect | 301 or 308 from the duplicate to the main page | Strong signal |
rel="canonical" in <head> | <link rel="canonical" href="..."> | Strong signal |
HTTP Link header | Link: <url>; rel="canonical" | Strong; useful for PDFs and files |
| Sitemap inclusion | Only the canonical address in the sitemap | Weak signal |
Notice that a redirect makes the duplicate disappear for users, while the canonical tag keeps both pages reachable. If the variant no longer needs to exist, choose the redirect; types and setup are covered in our guide to 301 and 302 redirects. If both pages must stay reachable (filters, parameters, variants), choose the canonical tag.
Each method can be combined with the others, as long as they all point to the same address. Contradictory signals lower the chance that Google follows your preference.
The rules from Google’s documentation:
<head>. A tag that ends up in the <body> is not considered valid.An HTML example, on a category page that can also be reached with parameters in the address:
<head>
<link rel="canonical" href="https://www.example.com/running-shoes/" />
</head>An example for a PDF, in the HTTP header (Apache):
<Files "guide-copy.pdf">
Header add Link '<https://www.example.com/guide.pdf>; rel="canonical"'
</Files>On WordPress, SEO plugins add a self-referencing canonical by default. Check a few page types (posts, categories, paginated pages, archives) to confirm the tags are what you expect. Platform basics are in our WordPress SEO guide.
This is where most time is lost, so here is a table of typical decisions:
| Situation | What to do |
|---|---|
http/https, www/non-www | 301 redirect to the chosen version, plus a self-referencing canonical |
| UTM and session parameters | Canonical to the address without parameters |
| Sorts and filters with no search value | Canonical to the base category or noindex, not both without a reason |
| Filter with real demand (category plus brand) | Own indexable page with content and its own canonical |
Paginated pages (?page=2) | Each page has its own canonical; do not point all to page 1 |
| Product in several categories | One canonical product URL, used in internal links |
| Content republished on another site | Canonical to the original source, or noindex at the partner |
| Language versions | Each version canonical to itself, with hreflang annotations |
For stores, remember the pagination rule: pointing page 1 as the canonical for the whole set hides the products on later pages. Category page structure is covered in our guide to category pages in a store.
For republished content, such as an article that also runs on a partner site, ask for a canonical pointing to your source. If you work with external publications, the difference between publishing formats is explained in our press release vs advertorial comparison. For languages, the canonical must stay within the same language; see the hreflang guide and the hreflang generator.
Suppose a store has a category called “Running shoes.” The same product list can be opened like this:
https://www.example.com/running-shoes/https://www.example.com/running-shoes/?sort=pricehttps://www.example.com/running-shoes/?utm_source=newsletterhttps://www.example.com/running-shoes/?page=2https://www.example.com/running-shoes/nike/The decision, address by address:
Without these decisions, a crawler can discover hundreds of combinations and treat them as separate pages. With them, Google gets the same story from several sources: HTML, internal links and sitemap all pointing to the same addresses.
These tools get mixed up, though they do different things:
| Tool | Effect | Use it when |
|---|---|---|
| Canonical | Consolidates signals on one address; both pages stay reachable | Duplicates that must exist |
| 301 redirect | Moves users and signals; the duplicate disappears | The old page should no longer be reached |
noindex | Removes the page from the index, with no consolidation | Pages with no search value (thank-you pages, internal search) |
| robots.txt | Blocks crawling, not indexing | Areas that should not be crawled; not for consolidation |
Google’s documentation explicitly advises against robots.txt for canonicalization: if you block access, Google cannot read the canonical tag. Do not combine noindex with a canonical to another page either, because you send opposite messages. For robots.txt, our generator helps you avoid accidental blocks.
Your canonical is a suggestion. Check what Google picked:
If Google picks a different address than yours, check internal links (do they point to different variants?), the sitemap, redirects and content differences between the pages. How to read these reports is explained in the Search Console guide, and the causes of exclusions in the guide to pages not indexed.
href="/running-shoes/" can be misread; use full addresses.<body>. The tag must be in the <head>.Be realistic about the limits:
A simple plan:
www) and redirect the rest.<head>.If you want someone to run these checks on your site, from canonicals to indexing, see our technical SEO service or reach us through contact.
Frequently asked questions
Usually not. Google groups similar pages and picks one to show. Penalties apply to duplication done to manipulate results, not to normal technical situations such as parameters or product variants. The real risk is that Google shows a different page than the one you want.
Yes, a canonical pointing to the page itself, called self-referencing, is recommended. It protects against parameters added by campaigns or external links and makes the preferred address clear. Many SEO plugins add it automatically; it is worth checking that they do it correctly.
Yes, Google accepts cross-domain canonicals, for example when content is republished on another site. It remains a hint, not an obligation. It works better when the pages are nearly identical and the partner actually adds the tag pointing to your original.
There is no fixed timeline. Google has to recrawl the pages involved and re-evaluate the duplicate cluster, which can take anywhere from a few days to a few weeks. You can request indexing of the key page in URL Inspection, but that does not guarantee an immediate change.
They can, if a filter creates variants nearly identical to the base category. If a filter matches a real search, such as category plus brand, it deserves its own indexable page with distinct content. The decision rests on actual search demand, not on a technical rule.
Related service
Keep reading
301 redirect or 302? The difference, how Google treats each, Apache and nginx code, a redirect map and the mistakes that cost you traffic.
Pages not indexed in Google Search Console: what each status means, how to find the cause and what to do, from noindex and canonicals to Crawled, not indexed.
Structured data schema in JSON-LD: which types are worth adding, code for an organization, article and product, how to validate and what Google retired.
Send us your website address and we’ll reply with a free initial analysis and a concrete SEO strategy — no strings attached.