Front page redirects break the canonical link

Created on 27 February 2018, almost 7 years ago
Updated 4 April 2023, over 1 year ago

By default, Drupal core does not redirect the home page node path to the home page. E.g. I configure the home page to be "node/1". I can still visit node/1. This makes sense, because Drupal also includes a canonical link to the to node, thanks to NodeViewBuilder.
I.e. in the html head:

<link rel="canonical" href="/node/1" />

After installing redirect module, visiting my home page E.g. example.com, will give me the canonical link as above. Now if I'm a search engine, I'll try to follow the canonical link... visit example.com/node/1 and I get served a redirect to example.com. Argh. This is essentially a redirect loop. Obviously not all search engines care, but for example in my case, Google Search Appliance with follow canonical links enabled is dying and not indexing any Drupal content.

Ideally I'd like to see an option to disable redirects for content set to be the home page - to avoid this particular problem.

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia pingers

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024