Project

General

Profile

Actions

Feature #102365

open

Regular expression with page id target

Added by Bernhard Eckl about 1 year ago. Updated 10 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
Category:
Link Handling & Redirect Handling
Target version:
-
Start date:
2023-11-13
Due date:
% Done:

0%

Estimated time:
PHP Version:
8.2
Tags:
Complexity:
Sprint Focus:

Description

When using a regular expression where the end of the url should be added to the target url, it is only possible via target external url but not with page id and adding $1 to the url.

E.g. the example here https://docs.typo3.org/c/typo3/cms-redirects/main/en-us/Usage/Index.html has target https://example.org/newpath/$1 but it would be great to have a target url like t3://page?uid=196/$1.

Actions #1

Updated by Stefan Bürk 10 months ago

  • Assignee set to Stefan Bürk

t3://page?uid=196/$1

does not make much sense - adding a "path" after starging with query arguments is not valid url syntax at all.

Please provide a full description of your redirect record created with all fields, at best using the TYPO3
monorepo along with the `ext:styleguide` - which can be used than to create a test first before trying to
change the implementation.

On the other hand, it would make clear what you want to pass to the target.

Additional, please mention TYPO3 version(s) ;)

Actions #2

Updated by Stefan Bürk 10 months ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Bernhard Eckl 10 months ago · Edited

What I mean is the following:

In nginx it would be:
rewrite ^/foo/(.*)$ https://domain.tld/bar/$1 permanent;

If the user calls an url like
https://domain.tld/foo/anotherdirectory
it would redirect to
https://domain.tld/bar/anotherdirectory

But I would like to redirect via TYPO3 because somebody could change the slug of the target page.
E.g.:
- Source path: /foo/(.*)$
- Target: t3://page?uid=196/$1
(page id 196 has slug called bar)

In other words: add a part of the source path to the target path but also use a page id in the target path.
Is it now more clean what I mean?

TYPO3 version: 11.5.33

Actions

Also available in: Atom PDF