Project

General

Profile

Actions

Bug #86835

open

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

Added by Chris Müller over 5 years ago. Updated 8 months ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2018-11-02
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 12 (3 open9 closed)

Related to TYPO3 Core - Bug #86615: Static route sitemap.xml is not working on single-page treeClosed2018-10-10

Actions
Related to TYPO3 Core - Bug #87095: Robots.txt not reachable if base is not "/"Closed2018-12-07

Actions
Related to TYPO3 Core - Bug #88902: Redirects are not resolved if there is a base path in default siteClosed2019-08-03

Actions
Related to TYPO3 Core - Feature #89518: Decouple static routes from site configUnder Review2019-10-25

Actions
Related to TYPO3 Core - Bug #87087: StaticRouteResolver ignores additional parametersClosed2018-12-05

Actions
Related to TYPO3 Core - Bug #87817: PageLinkBuilder fails adding pagetype parameter, if routeEnhancers for PageTypeSuffix is definedClosed2019-03-01

Actions
Related to TYPO3 Core - Bug #88836: page type not respected under some circumstancesClosed2019-07-24

Actions
Related to TYPO3 Core - Bug #89346: sitemap.xml does not work correctlyNew2019-10-04

Actions
Related to TYPO3 Core - Bug #87104: PageTypeSuffix removes type parameter for non mapped type valuesClosed2018-12-07

Actions
Related to TYPO3 Core - Bug #87016: Seo sitemap does not note routeEnhancer on extensionsClosed2018-11-27

Actions
Related to TYPO3 Core - Bug #94244: PageTypeSuffix Enhancer buggyNew2021-05-31

Actions
Has duplicate TYPO3 Core - Bug #88543: Static routes does not work if no language serves root levelClosed2019-06-12

Actions
Actions #1

Updated by Chris Müller over 5 years ago

  • Description updated (diff)
Actions #2

Updated by Markus Klein over 5 years ago

  • Related to Bug #86615: Static route sitemap.xml is not working on single-page tree added
Actions #3

Updated by Georg Ringer over 5 years ago

  • Related to Bug #87095: Robots.txt not reachable if base is not "/" added
Actions #4

Updated by Andreas Kiessling almost 5 years ago

@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

Actions #5

Updated by Andreas Kiessling almost 5 years ago

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.

Actions #6

Updated by Chris Müller almost 5 years ago

  • Related to Bug #88543: Static routes does not work if no language serves root level added
Actions #7

Updated by Susanne Moog over 4 years ago

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.

Actions #8

Updated by Chris Müller over 4 years ago

I agree. For me, this issue can be closed.

Actions #9

Updated by Sebastian Schawohl over 4 years ago

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?

Actions #10

Updated by Daniel Goerz over 4 years ago

  • Related to Bug #88902: Redirects are not resolved if there is a base path in default site added
Actions #11

Updated by Daniel Goerz over 4 years ago

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).

Actions #12

Updated by Daniel Goerz over 4 years ago

  • Related to Feature #89518: Decouple static routes from site config added
Actions #13

Updated by Tymoteusz Motylewski over 4 years ago

  • Related to Bug #87087: StaticRouteResolver ignores additional parameters added
Actions #14

Updated by Tymoteusz Motylewski over 4 years ago

  • Related to Bug #87817: PageLinkBuilder fails adding pagetype parameter, if routeEnhancers for PageTypeSuffix is defined added
Actions #15

Updated by Tymoteusz Motylewski over 4 years ago

  • Related to Bug #88836: page type not respected under some circumstances added
Actions #16

Updated by Tymoteusz Motylewski over 4 years ago

  • Related to Bug #89346: sitemap.xml does not work correctly added
Actions #17

Updated by Tymoteusz Motylewski over 4 years ago

  • Related to Bug #87104: PageTypeSuffix removes type parameter for non mapped type values added
Actions #18

Updated by Tymoteusz Motylewski over 4 years ago

  • Related to Bug #87016: Seo sitemap does not note routeEnhancer on extensions added
Actions #19

Updated by Susanne Moog about 4 years ago

  • Sprint Focus set to On Location Sprint
Actions #20

Updated by Daniel Goerz about 4 years ago

  • Related to deleted (Bug #88543: Static routes does not work if no language serves root level)
Actions #21

Updated by Daniel Goerz about 4 years ago

  • Has duplicate Bug #88543: Static routes does not work if no language serves root level added
Actions #22

Updated by Loon Buster about 4 years ago

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 :)

Actions #24

Updated by Susanne Moog about 4 years ago

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.

Actions #25

Updated by Markus Mächler about 4 years ago

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.

Actions #26

Updated by Bernhard Eckl almost 3 years ago

  • Related to Bug #94244: PageTypeSuffix Enhancer buggy added
Actions #27

Updated by Susanne Moog over 1 year ago

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

Actions #28

Updated by Benni Mack 8 months ago

  • Sprint Focus deleted (On Location Sprint)
Actions

Also available in: Atom PDF