# Homepage doesn't have canonical URL

**URL:** https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450
**Category:** Feature
**Created:** [September 21, 2016, 7:34pm UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450 "2016-09-21T19:34:09Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [September 21, 2016, 7:34pm UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/1 "2016-09-21T19:34:09Z")

</div>

Long story short: it seems like the homepage doesn’t have a canonical URL tag… ?

That’s relevant when you change the hostname of the site and don’t want to redirect everything yet,

and in order to avoid search index entries like [http://forum.domain.com?blahblahblah](http://forum.domain.com?blahblahblah) in case someone links to it that way.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 21, 2016, 5:18am UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/2 "2016-10-21T05:18:23Z")

</div>

I do not see the purpose of this request?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [October 21, 2016, 5:43am UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/3 "2016-10-21T05:43:15Z")

</div>

The only possible reason I can see for this regarding the “home” page is for “link and ranking signals” when

> **[How to Specify a Canonical with rel="canonical" and Other Methods | Google...](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls?hl=en&visit_id=639159006115716940-22142312&rd=1)**
>
> When a site has duplicate content, Google chooses the canonical URL. Learn more about canonical URLs and how to consolidate duplicate URLs.

> Your server is configured to serve the same content for the www subdomain or the http protocol.

But this can be more easily achieved on an individual basis without touching any Discourse code.

> Set your preferred domain  
> Tell Google which version of your site’s URL you prefer for your domain:

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [October 21, 2016, 5:47am UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/4 "2016-10-21T05:47:27Z")

</div>

> [@codinghorror](#):
>
> I do not see the purpose of this request?

It’s in my post.

> [@michaeld](#):
>
> That’s relevant when you change the hostname of the site and don’t want to redirect everything yet,  
> and in order to avoid search index entries like [http://forum.domain.com?blahblahblah](http://forum.domain.com?blahblahblah) in case someone links to it that way.

> [@Mittineague](#):
>
> But this can be more easily achieved on an individual basis without touching any Discourse code.

Yes, that’s a solution for Google that can be used in case the software does not use a canonical URL.  
But I see this as a last resort and a means to fix up an issue with a site. I would indeed require fixing it on an individual basis and it does not solve the ?blablah issue. And… you do know that Google is not the only search engine, right?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [October 21, 2016, 5:53am UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/5 "2016-10-21T05:53:06Z")

</div>

> [@michaeld](#):
>
> But I see this as a last resort

I see it as the first and only necessary approach and I seriously doubt its necessary at all.

> [@michaeld](#):
>
> you do know that Google is not the only search engine, right?

Of course, but also I think being obsessed about micro-managing supposed SEO “tricks” is a major waste of time, energy and effort.

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [October 21, 2016, 5:57am UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/6 "2016-10-21T05:57:55Z")

</div>

This is not about SEO tricks or being obsessed.

It’s about people changing their hostname or domain name and after three months they find out that search engines picked up that change perfectly except for their home page, which is now twice in the search engine index.

I’m a bit confused here since the necessity seems very clear to me. I see this topic has even been reclassified as a feature, while I’m convinced that the code path for the home page just _forgets_ to call `canonical_url` …

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 21, 2016, 10:24am UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/7 "2016-10-21T10:24:55Z")

</div>

> [@michaeld](#):
>
> when you change the hostname of the site and don’t want to redirect everything yet

This seems like such a bad idea, I’m not sure why anyone would want to encourage it?

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [October 21, 2016, 11:33am UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/8 "2016-10-21T11:33:48Z")

</div>

> [@codinghorror](#):
>
> This seems like such a bad idea, I’m not sure why anyone would want to encourage it?

Not encouraging, but supporting it would be desirable.  
One specific example where this would be handy is to have a soft launch of a rebranding, where you want to communicate the new URL to search engines before communicating it to the customers.  
(Real life example)

Another thing is that a third party can cause a search engine issue by causing duplicate content issues by linking to your home page with arbitrary parameters.

> **[Duplicate content: Causes and solutions](https://yoast.com/duplicate-content/#url-parameters)**
>
> You might have duplicate content issues without even knowing it! Discover the common causes, and how to identify and fix them in this guide.

This is caught on every page of a Discourse installation except for the home page - because of the fact that the call to `canonical_url` is just omitted there. I would make a pull request if I was able to determine the exact code path for the home page…

---

<div class="post-metadata">

### Author: ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)
#### Post date: [May 22, 2019, 4:58pm UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/9 "2019-05-22T16:58:26Z")

</div>

@michaeld Hello!

> [@michaeld](#):
>
> and in order to avoid search index entries like [http://forum.domain.com?blahblahblah](http://forum.domain.com?blahblahblah) in case someone links to it that way.

Ya, this happens. I can confirm this. Another reason, why we may like to have **canonical** for the Homepage is the permalink /latest and / shows and index duplicate content.

Similarly, I have been trying hard to noindex via GTM but yet I’ve not been able to see effect.

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/3/63f0dddeff3ac8c20d4bc31c3aabd529ed4e69c6.png)

I hope to noindex these common pages from first day of Discourse installation.

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [January 4, 2020, 4:02pm UTC](https://meta.discourse.org/t/homepage-doesnt-have-canonical-url/50450/10 "2020-01-04T16:02:56Z")

</div>

url like `/latest？exclude_category_ids%5B%5D=20&exclude_category_ids%5B%5D=19&no_definitions=true&page=1` is be index by google, seems meanless to user
