Problem/Motivation

Follow up from #2833457: Allow redirect between domains.
The domain redirect module offers the users to redirect between domains.

Wildcard redirects are also allowed, so for example a user can redirect:
a) example.com/* ---> redirected.com/example
b) example.com/subpath ---> secondredirect.com/subpath

The problem here is that the redirect a) will catch all requests including example.com/subpath from b) redirect.

Proposed resolution

In order to fix this problem there are 2 solutions to prioritize the redirects:
1. Sort the redirects automatically on submit in that way that the wildcards come last for response
2. Make the redirect table draggable for the user to reorder the redirects manually.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Ginovski created an issue. See original summary.

ginovski’s picture

Assigned: Unassigned » ginovski
Status: Active » Needs review
StatusFileSize
new5.46 KB

Added automatic sorting along with test and added help description.

wim leers’s picture

Title: Sort the domain redirects » Sort the domain redirects: handle wildcard redirects last, prefer more specific redirects
basvredeling’s picture

Status: Needs review » Needs work

Patch doesn't apply to latest dev any more (in a composer workflow).

basvredeling’s picture

Status: Needs work » Needs review
StatusFileSize
new5.47 KB

This patch is mostly identical. Only checksum and translatable changed.

berdir’s picture

Status: Needs review » Needs work

You need to upload the file as a .patch (not .patch.txt) so it can be tested.

basvredeling’s picture

StatusFileSize
new5.47 KB
basvredeling’s picture

Status: Needs work » Needs review