Make source paths (= "From") work without language prefix

Created on 30 April 2013, about 12 years ago
Updated 20 May 2025, about 4 hours ago

Problem

Currently the language for a redirect applies to both, source (From) and redirect (To). If you want to redirect to a german page let's say - then the actual redirect source needs to be a german path as well. When you want to use redirect module to redirect legacy paths to new drupal paths, this is a blocker.

Example

An example: You want to redirect "the-old-german-path.html" to the "de/new-fancy-drupal-path" (alias for node/123 in language German). If you try to use the old path as a "From" source, the new path as "To", and choose German as a language, then the redirect is only triggerd on 'de/the-old-german-path.html' - as the language you have chosen for the redirect is German.

Proposed Solution

As a proposed solution, I added a new setting to each redirect, called "Language neutral source". If this checkbox is set, then the redirect is triggered without language prefix. The language in the prefix is still used for the target (To) path.

Before: de/the-old-german-path.html redirects to de/new-fancy-drupal-path
After: the-old-german-path.html redirects to de/new-fancy-drupal-path

A patch follows...

πŸ“Œ Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany valderama

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