#111143HrefLangGenerator renders alternates for mount point URLs while the canonical points to the mounted page
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
- 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.
- 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
-
Gerrit Code Review pushed patch set 1 for main to change 96857 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-19T08:58:57+00:00" > 10/19/26, 08:58 </span>