Issue Bug Accepted Quiet

#86835Static route sitemap.xml is still not working on single-page tree

Chris Müller 11/02/18, 13:24 updated 10/02/26, 12:32

Description

The bug #86615 already exists after an update to TYPO3 9.5.1.

I have a multi-language, single-page tree site configuration. I added a sitemap.xml into the config.yaml via the new Site Management menu.

rootPageId: 3
base: ‘https://www.example.net/‘
baseVariants:
-
base: ‘http://example.ddev.local:8080/‘
condition: ‘applicationContext "Development"'
-
base: 'https://staging.example.net/'
condition: 'applicationContext “Production/Staging”‘
-
base: ‘http://testing.example.net/‘
condition: ‘applicationContext == “Testing”‘
languages:
-
title: English
enabled: true
languageId: ’0’
base: /en/
typo3Language: default
locale: en_US.utf8
iso-639-1: en
navigationTitle: English
hreflang: en
flag: us
-
title: Deutsch
enabled: true
languageId: ’1’
base: /de/
typo3Language: de
locale: de_DE.utf-8
iso-639-1: de
navigationTitle: Deutsch
hreflang: de
fallbackType: strict
flag: de
errorHandling:
-
errorCode: ’404’
errorHandler: Page
errorContentSource: ‘t3://page?uid=96’
routes:
-
route: sitemap.xml
type: uri
source: ‘t3://page?uid=3&type=1533906435’

Using /sitemap.xml redirects me to /en/.

Calling /?type=1533906435 redirects me also to /en/. But using /en/?type=1533906435 shows me the sitemap index. Calling the URL from the sitemap xml:

http://example.ddev.local:8080/en/?sitemap=pages&cHash=0fe835841492c3b52e6090c6a7f6f310

shows me the content from /en and no sitemap.

Addition: I encounter this problem on a local ddev environment with the default .htaccess delivered with the core.

Reviews 3

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch

Commit message
[BUGFIX] Static route sitemap.xml is still not working on single-page tree Resolves: #86835 Releases: main

History 2930

Show 5 earlier messages
  1. Andreas Kießling commented <span data-processor="relativetime" data-value="2019-05-17T15:30:19+00:00" > 05/17/19, 15:30 </span>

    @Chris Müller
    Does this work for you now? I’m having serious trouble getting the sitemap to work at all, neither / nor /de/ as base language segment works for me

  2. Andreas Kießling commented <span data-processor="relativetime" data-value="2019-05-18T14:32:10+00:00" > 05/18/19, 14:32 </span>

    The topic of this report is wrong, it’s not just the sitemap.xml, but in general all static routes and redirects are screwed up, if there is no entrypoint with just a “/”

    —Update—
    I think i found the culprit: the SiteBaseRedirect should only kick in, in the documented case:

    // Usually called when "https://www.example.com" was entered, but all sites have "https://www.example.com/lang-key/"
    // So a redirect to the first possible language is done.

    But since there is no check, if the called url is actually “empty”, it just handles everything that can not be mapped to a configured language.

  1. Susanne Moog commented <span data-processor="relativetime" data-value="2019-08-29T15:26:03+00:00" > 08/29/19, 15:26 </span>

    This is basically done on purpose, as you can have multiple sites with the same base and different language configurations.

    If two sites had / as base (and lang configs) which static route config is to be taken? The configuration in this case is undefined and instead of doing unpredictable “magic” by chosing any one of them, we are currently only using the config that is defined.

  2. Sebastian Schawohl commented <span data-processor="relativetime" data-value="2019-09-05T16:57:29+00:00" > 09/05/19, 16:57 </span>

    I don’t understand: static routes are defined per sites, so even if two sites have / as base it should not be a problem.

    The only way to make static routes work in a multi-language site is to have the default language with / as a base?

  3. Daniel Goerz commented <span data-processor="relativetime" data-value="2019-10-25T18:31:05+00:00" > 10/25/19, 18:31 </span>

    Susanne Moog wrote:
    > This is basically done on purpose, as you can have multiple sites with the same base and different language configurations.
    >
    > If two sites had / as base (and lang configs) which static route config is to be taken? The configuration in this case is undefined and instead of doing unpredictable “magic” by chosing any one of them, we are currently only using the config that is defined.

    We tried to find a solution for all use cases but unfortunately this is not possible with the current architecture of static routes. The main design flaw is that static routes are bound to sites but sites do not have to be exclusive in terms of their base. This leads to an arbitrary static route resolving.

    To circumvent the current restriction on site configurations that have no dedicated entry point “@/@” please consider rearranging the Middlewares in your installation. Refer to the documentation on how this can be achieved: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/RequestHandling/Index.html#override-ordering-of-middlewares

    In the long run we need to decouple static routes from site configuration and treat them more like redirects are treated now. They need to be globally defined to remove the arbitrariness when resolving. In this case we could think about serving them in a dedicated sysext (like redirects) because then the functionality could be removed completely if not needed (to reduce bloat).

  4. Loon Buster commented <span data-processor="relativetime" data-value="2020-02-07T00:04:38+00:00" > 02/07/20, 00:04 </span>

    somebody have nothing better to do than to put unfinished system online? .. oh wait free T3v8 support until “2020-03-31” ..incompetent or calculating? i thing it’s just financed foresight :)

  5. Susanne Moog commented <span data-processor="relativetime" data-value="2020-03-04T17:29:47+00:00" > 03/04/20, 17:29 </span>

    Markus Mächler wrote:
    > Couldn’t we use the reordering feature switch rearrangedRedirectMiddlewares that has been used to fix the same problem with redirects?
    >
    > https://forge.typo3.org/issues/88902
    > https://forge.typo3.org/projects/typo3cms-core/repository/revisions/ffd69f0bc8ebf23dbb4d736a058746bbbde5f08d/diff/typo3/sysext/redirects/Configuration/RequestMiddlewares.php

    Yes, as Daniel stated in #11 this is a valid work around in your projects – however, it is not a solution we could use in the core for the issues and cases mentioned above.

  6. Markus Mächler commented <span data-processor="relativetime" data-value="2020-03-05T09:41:08+00:00" > 03/05/20, 09:41 </span>

    Thanks for the explanations. What about including this with the same feature switch and throwing an InvalidSiteConfigurationException or something in case two sites with the same base but different language settings define the same static route? This could be an intermediate step for TYPO3 10 LTS until static routes are redesigned completely.

  7. Susanne Moog commented <span data-processor="relativetime" data-value="2022-11-11T08:39:51+00:00" > 11/11/22, 08:39 </span>

    This should be solved if #89518 is done – it’s currently pending and you could help out by reviewing and testing the patch.