Option to keep original path on domain redirect

Created on 23 August 2017, almost 7 years ago
Updated 22 March 2024, 3 months ago

Problem/Motivation

For domain redirects, it is sometimes useful to append the original request path to the destination domain. For example:

https://sample-a.com/some/path -> https://sample-b.com/some/path

While this can be done now, it requires entering every possible path as a separate domain redirect.

Proposed Solution

Add a checkbox option to the domain redirect form to append the original path to the target. That allows you to then configure a wildcard redirect from one domain to another with just a single configured domain redirect:

https://sample-a.com/* -> https://sample-b.com/*

Original Summary

Good day,

we want to use the redirect module for domain redirection in our projects.
Currently, the query string is not retained through the redirect.

I've created a patch of the redirect_domain sub module where I added a new field 'keep path' to the domain redirection.
It's a checkbox and if set, the query string is retained through the redirection. I've also extended the tests to check the new field.
Details can be found in the attached patch.

Is this approach compliant with the idea of the module?

This is my first contribution, feel free to point out mistakes in my workflow.

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland pvbergen

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.69.0 2024