Issue Feature Rejected

#97962Allow more / special chars in slug creation

Andreas Kießling 07/16/22, 19:23 updated 04/16/25, 16:59

Description

For a relaunch project with TYPO3 11, the urls are migrated from a previous realurl setup with .html urls to the now standard without .html, / etc.

There are however some special pages that need to be kept with their previous url – meaning abc/def.html since external applications, mobile apps etc. load them and i can’t risk or even properly test the behavior when they are served a redirect to a new url.

When i enter that slug in the page properties, the regex from the slughelper kicks in and removes all special characters
https://github.com/TYPO3/typo3/blob/597a92fd55221caaccd28628b5e03024a319ef7a/typo3/sysext/core/Classes/DataHandling/SlugHelper.php#L125

Is there a technical reason not to allow more chars like uppercase and unreserved chars?
See https://datatracker.ietf.org/doc/html/rfc3986#section-2.3
I’m fine with lowercasing and removing special chars when the slug is generated from TCA fields, but for manual editing we should try allow everything that is technically allowed.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 5

  1. Oliver Hader commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2022-11-03T09:22:17+00:00" > 11/03/22, 09:22 </span>

    Can you please add examples and/or screenshots, which makes it easier to understand and reproduce the scenario? Thanks in advance!

  2. Andreas Kießling commented <span data-processor="relativetime" data-value="2022-11-03T09:55:11+00:00" > 11/03/22, 09:55 </span>

    The slug config for a site is by default configured to create urls like https://www.example.com/foo
    I need some of the URLs to end with .html because they are hardcoded somewhere else, don’t follow redirects etc. and i can not test the behavior of these applications beforehand.

    Now when you enter bar.html in the slug field to get an url like https://www.example.com/bar.html, this will be changed to barhtml since https://github.com/TYPO3/typo3/blob/597a92fd55221caaccd28628b5e03024a319ef7a/typo3/sysext/core/Classes/DataHandling/SlugHelper.php#L125 does not allow it, as well as other chars like _ ~. or uppercase chars.

  3. Georg Ringer commented and changed status Needs Feedback Rejected <span data-processor="relativetime" data-value="2025-04-16T16:59:27+00:00" > 04/16/25, 16:59 </span>

    Hey Andreas,

    I just saw this old issue and I am rejecting this issue. This will lead to more issues having different ending + PageTypeSuffix. I suggest hooking into one of the middlewares to fetch the proper page.

    hope this is ok for you!