Project

General

Profile

Actions

Bug #101191

closed

Redirects with regexp endabled and same urls, but one with additional query params matching the wrong one first

Added by Marc Bastian Heinrichs 11 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Redirect Handling
Target version:
-
Start date:
2023-06-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Example:
Need to match on two urls, each with different variants, that's why regexp is enabled, but one differs only by the query params from the other:

  1. /foo/(different_part)bar.html
  2. /foo/(different_part)bar.html?type=101

Created two regexp redirects records in this order (important):

  1. /\/foo\/(.*)bar.html$/ with target A
  2. /\/foo\/(.*)bar.html\?type=101/ with target B

With url 2 record 1 matches first, which is wrong. Record 2 should match first
If the redirect records are created the other way round it works correct, but this is not the solution.

IMO the foreach for the regexp redirects in RedirectService::matchRedirect needs to be run though twice, first with query and second one without, instead of a single run.

Actions

Also available in: Atom PDF