Front page always redirects to /home

Created on 12 December 2024, 7 days ago

Problem/Motivation

Found via 📌 Add performance testing Active because it started registering double of everything in the anonymous home page test. Every time you visit the the front page, you get 301 redirected to /home

This is an extra server round trip when people browse to or click on the front page of the site and seems unnecessary.

I didn't look into what's causing it, so it could be on purpose, or maybe a side-effect of redirect settings?

Either way it would be better from a performance point of view to avoid the redirect, especially for slower connections etc.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Component

Base Recipe

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

  • Issue created by @catch
  • 🇬🇧United Kingdom catch
  • 🇦🇺Australia pameeela

    It's definitely not on purpose, but seems like a bug caused by the order of things.

    We are setting the home page to '/home' because we can't assume the node ID of this page on install. But, I think the node doesn't exist when this config is set, so it's not connecting properly. If I simply save the site settings form, the redirect no longer occurs. (And if I change the initial config to be

    '/node/2'

    on install it also works as expected. But we can't do that.)

    This is a pretty weird exception because you can't save the form from the UI to set an invalid path, so this is pretty hard to replicate without recipes and default content. You can reproduce it if you manually import the config with an invalid path, and then create the node with the matching alias after -- but seemingly only with Pathauto installed; it doesn't occur in vanilla Drupal, I think because in that case you are setting the alias manually on the node.

    I haven't dug into this any deeper because I am sure there are others who would be much better equiped to look at how this is actually wired up in core :)

  • 🇬🇧United Kingdom catch

    OK I don't think I've ever seen this before. Changing to a bug report. Should be relatively easy to debug at least the symptom if not the root cause by sticking a backtrace in RedirectResponse and seeing what calls it.

Production build 0.71.5 2024