#96010Translated pages can be loaded with slug of default language
Description
Reproduce
1. Install TYPO3 with latest core and introduction package (e.g. with DDEV https://docs.typo3.org/m/typo3/guide-contributionworkflow/master/en-us/Appendix/SettingUpTypo3Ddev.html) and then install introduction package
Site configuration should also be created automatically, is:
typo3conf/sites/introduction/config.yaml
base: /
languages:
-
title: English
enabled: true
languageId: 0
base: /
typo3Language: default
locale: en_US.UTF-8
iso-639-1: en
navigationTitle: English
hreflang: en-US
direction: ''
flag: us
-
title: Dansk
enabled: true
languageId: 1
base: /da/
typo3Language: da
locale: da_DK.UTF-8
iso-639-1: da
navigationTitle: Dansk
hreflang: da-DK
direction: ''
fallbackType: fallback
fallbacks: ''
flag: dk
-
title: German
enabled: true
languageId: 2
base: /de/
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-DE
direction: ''
fallbackType: fallback
fallbacks: '1,0'
flag: de
rootPageId: 1
websiteTitle: 'TYPO3 Introduction Package'
2. Create translation (German) for page /features, set slug to /features-de.
Revert redirects to reduce site-effects.
3. Enable the translated page
4. Load the 2 URLs:
/de/features-de(this is correct)/de/features(this is not – it uses the slug of the default language)
Actual result
both URLs load the same page
Also compare the source code – it will show the same canonical URL and same page ID:
<link rel="canonical" href="/de/features-de"/>
<body id="p81" class="page-81 pagelevel-1 language-2 backendlayout-default layout-default">
Expected result
/de/features should show an error page
Versions
- was reproduced with latest master
- also 10.4.21
Impact
This results in duplicate content: same page with several URLs. This can also result in redirect chains which do not get detected with redirect:checkintegrity (I had several of these, investigating I found this issue).
Reviews 5
- 11.5 79705[BUGFIX] Resolve page with trailing slash requested without one
- 12.4 79679[BUGFIX] Resolve page with trailing slash requested without one
- main 79249[BUGFIX] Resolve page with trailing slash requested without one
- 11.5 76494[BUGFIX] Prevent resolving translated page with default slug
- main 75101[BUGFIX] Prevent resolving translated page with default slug
Related issues 3
- Bug #88715Wrong routes for default url slugs on translated base path pages
- Bug #99554After I've installed patch lvl 11.5.18, mount points with non translated slugs stoped working and shows 404 in the FE.
- Bug #100990Pages with trailing slash in slug are not resolved if requested uri does not contain a trailing slash