Use full regex in Redirect Domain module

Created on 13 September 2021, over 3 years ago
Updated 17 February 2025, about 2 months ago

Problem/Motivation

We're just moving 4 domains into 1 new and the Redirect Domain module solves many cases. It would be even better if we could use the full scope of regular expressions instead of just * (which is actually replaced in code into .* and used as regex too).

Steps to reproduce

Would be nice to do something like this and use named capturing groups.
Sub path:
\/(?P<lang>[^\/]+\/)?foobar(?P<version>[0-9]{4})\/[a-zA-Z]{2}\/(?P<id>.*)
and destination:
/<lang>doc/foobar/<version>/<id>

Proposed resolution

Instead of using cores https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Path%21Pa... replace it with custom functionality or at least allow switching to advanced more.

Maybe also checkbox after "Sub path" input enabling regex for that particular field could be an option?
Something like this This would allow adding new feature with backwards compatibility. Maybe most people don't want such a feature either so it would be best for all.

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

🇪🇪Estonia hkirsman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024