Issue Bug Closed

#96010Translated pages can be loaded with slug of default language

Sybille Peters 11/17/21, 11:05 updated 12/06/22, 21:43

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