---
title: How to Specify a Canonical URL
description: "When you have multiple URLs showing the same or very similar content, you can *tell Google* which URL is the \"main\" or canonical one by using several methods — from strongest to weakest signals: ### **1. Redirects (Strongest Signal)** -…"
url: "https://fsidm.in/knowledge/seo/how-to-specify-a-canonical-url/"
updated: "2025-08-20"
category: SEO
---

# How to Specify a Canonical URL

When you have multiple URLs showing the same or very similar content, you can *tell Google* which URL is the "main" or canonical one by using several methods — from strongest to weakest signals:

### **1. Redirects (Strongest Signal)**

- Use **301 redirects** to permanently point duplicate URLs to your preferred canonical URL.
- This tells Google to treat the redirected URL as canonical.
- Best when you want to get rid of duplicate URLs entirely.

### **2. rel="canonical" Link Annotation (Strong Signal)**

- Add a <link rel="canonical" href="https://yourcanonicalurl.com/page" /> tag in the <head> of duplicate HTML pages.
- This tells Google that the specified URL is the preferred canonical version.
- Use **absolute URLs** (full URL with protocol and domain).
- Example:

<head>

  <title>Product Page</title>

  <link rel="canonical" href="https://www.example.com/dresses/green-dress" />

</head>

- For **mobile versions** on a separate URL, also add a rel="alternate" link for the mobile variant:

<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/dresses/green-dress" />

- Use this method for HTML pages.
- You can also specify canonical URLs via **HTTP headers** for non-HTML files like PDFs.

### **3. Sitemap Inclusion (Weak Signal)**

- List your preferred canonical URLs in your XML sitemap.
- Helps Google understand which URLs you consider important.
- Easier to maintain on large sites.
- Google will still decide which pages are duplicates and canonical.

### **4. Other Notes & Best Practices**

- **Don’t mix canonical URLs across methods** for the same page (e.g., don’t have one URL in sitemap and a different one in rel=canonical).
- Avoid using **robots.txt** or **URL removal tools** to control canonicalization—they don’t work for this.
- Don’t use **noindex** to solve duplicates—it removes pages from search entirely.
- Link internally to your canonical URLs rather than duplicates to reinforce preference.
- If your site has **HTTPS and HTTP versions**, prefer HTTPS as canonical by using redirects and canonical tags.
- For **multi-language sites**, specify canonicals within the same language group.

**Summary Table**

| **Method** | **Strength** | **Use Case** | **Notes** |
| --- | --- | --- | --- |
| Redirects (301) | Strongest | When removing duplicates | Fastest way to consolidate URLs |
| rel="canonical" tag | Strong | Preferred method for HTML pages | Must be in <head>, use absolute URLs |
| rel="canonical" header | Strong (for non-HTML files) | PDFs, Word docs, etc. | Server configuration needed |
| Sitemap URLs | Weak | Large sites | Helps but doesn’t enforce canonicals |

### **Why Specify a Canonical URL?**

- Decide which URL appears in search results.
- Consolidate ranking signals (backlinks, social shares).
- Simplify analytics and tracking.
- Save crawl budget by avoiding duplicate crawling.
