Issue Feature New

#107296PageTypeDecorator: type suffix mapping option limited to root url

Ayke Halder 08/15/25, 13:23 updated 11/09/26, 11:06

Description

Having this configuration:

PageTypeSuffix:
  type: PageType
  default: '/'
  index: ''
  map:
    'sitemap.xml': 1533906435

Especially sitemaps must be accessible via the root-url only:

On sub-pages there is no need for the sitemap type to be used as suffix:

And therefore the url from above should not be resolved to type=1533906435, but either to type=0 or even better show error “page not found”.

Solution

Implement new mapping configuration option with prefix ^.

PageTypeSuffix:
  type: PageType
  default: '/'
  index: ''
  map:
    '^sitemap.xml': 1533906435

Url resolution result:

Corresponding link generation:

“Security” considerations

This solution would still allow urls like this to work:

If there is a kind of “blocking” necessary for a specific type on sub-pages, this must be additionally implemented as mentioned in comment:
https://forge.typo3.org/issues/105837#note-6

> – We introduce a TypoScript option “limitToPages = root” to allow PAGE objects [with a specific typeNum] to be accessible only for specific page IDs.

  pageSitemap = PAGE
  pageSitemap {
    typeNum = 1533906435
    limitToPages = root
  }

Reviews 1

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
[FEATURE] PageTypeDecorator: type suffix mapping option limited to root url Resolves: #107296 Releases: main

History 712