Missing canonical URL on direct post links

Continuing the discussion from:

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

We are missing canonical URLs on specific post links eg

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.

1 Like

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.

1 Like

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

5 Likes