Issue Bug Under Review Quiet

#111143HrefLangGenerator renders alternates for mount point URLs while the canonical points to the mounted page

Alexander Hahn 10/19/26, 08:37 updated 10/19/26, 08:58

Description

Prerequisites

Two sites with English and German:

  • the main site example.com
  • a product site product.example.com with a translated start page

Steps to reproduce

  1. On example.com, create a translated page “Product” of type “Mount Point”. Mount the start page of product.example.com and enable “Show content of mounted page”. Set the same page type on the translation.
  2. Open example.com/product and look at the head.

Actual result

<link rel="canonical" href="https://product.example.com/">
<link rel="alternate" hreflang="en" href="https://www.example.com/product">
<link rel="alternate" hreflang="de" href="https://www.example.com/de/produkt">

The canonical says “the real page is on product.example.com”, the hreflang tags say “the language versions are on example.com”. Search engines ignore hreflang that points to non-canonical URLs.

Expected result

Canonical and hreflang point to the same site.

Additional information

  • Reproduced on 13.4.35 for the mount point page with “Show content of mounted page”. Per #93300 subpages below a mount point are affected as well. Same code in 14.3 and main.
  • CanonicalGenerator::checkDefaultCanonical() removes the mount point before building the URL (since #93300), HrefLangGenerator::__invoke() does not.
  • Possible fix: skip hreflang when the page is rendered through a mount point, like the existing skip for an explicit canonical_link. Alternatively, build the alternates for the product site, which needs its languages and URLs.

Related: #93300

Reviews 1

History 01