# Missing canonical URL on direct post links

**URL:** https://meta.discourse.org/t/missing-canonical-url-on-direct-post-links/33543
**Category:** Bug
**Created:** [September 21, 2015, 9:12pm UTC](https://meta.discourse.org/t/missing-canonical-url-on-direct-post-links/33543 "2015-09-21T21:12:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 21, 2015, 9:12pm UTC](https://meta.discourse.org/t/missing-canonical-url-on-direct-post-links/33543/1 "2015-09-21T21:12:23Z")

</div>

Continuing the discussion from:

[https://meta.discourse.org/t/canonical-tag-generated-with-page-2/32842](https://meta.discourse.org/t/canonical-tag-generated-with-page-2/32842)

We are missing canonical URLs on specific post links eg

```plaintext
http://www.helloforos.com/t/chic-s-me-llego-la-inspiracion-hallowinesca-y-me-fui-de-compras/20920/18

```

This has regressed and is hurting google juice.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 21, 2015, 11:08pm UTC](https://meta.discourse.org/t/missing-canonical-url-on-direct-post-links/33543/2 "2015-09-21T23:08:41Z")

</div>

WOW, this was broken in 2013

> <https://github.com/discourse/discourse/commit/cab4d95eaf6902e35798a914e269f57eb888cec0#diff-8e904d13bca5807aec0e6f61c67f1c96>

adding a test case so this don’t happen again.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 21, 2015, 11:39pm UTC](https://meta.discourse.org/t/missing-canonical-url-on-direct-post-links/33543/3 "2015-09-21T23:39:31Z")

</div>

Well it is not quite this bad, it has been completely broken for the entire 1.4 cycle, somehow, magical Rails pixies made this broken code work up until the pixies were removed on a certain Rails upgrade…

Anyway

Fixed now and tested, so pixies do not break it again:

[https://github.com/discourse/discourse/commit/a0524ea4d1aaa9481a97e82f64688f1a816addfb](https://github.com/discourse/discourse/commit/a0524ea4d1aaa9481a97e82f64688f1a816addfb)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 21, 2015, 11:39pm UTC](https://meta.discourse.org/t/missing-canonical-url-on-direct-post-links/33543/4 "2015-09-21T23:39:39Z")

</div>


