Issue Bug Closed

#110619Cannot restrict "redirects:cleanup" command by domain

Mathias Brodala 09/04/26, 07:33 updated 09/14/26, 15:57

Description

The redirects:cleanup command supports a --domain argument to supposedly filter matching redirects by a domain/source host.

However, using this argument never yields any results.

The reason is the way the internal query is set up. First it populates the query from the demand based on CLI input. Afterwards it unconditionally adds another source host constraint. This results in a SQL query like this:

SELECT `uid`, `source_host`, `target`
FROM `sys_redirect`
WHERE (`source_host` IN ('example.org')) AND (`creation_type` = 0) AND (`source_host` IN ('*')) AND (`sys_redirect`.`deleted` = 0)
ORDER BY `source_host` asc, `source_host`

The source_host constraint here is impossible since the `source_host` field cannot be a specific domain (example.org here) and * at the same time.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 3

  1. Wouter Wolters commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2026-09-04T19:03:29+00:00" > 09/04/26, 19:03 </span>

    This is solved by https://forge.typo3.org/issues/110620
    Root cause: cli was not authenticated, so isAdmin() returned false and the permission guard added source_host IN (‘*’).

  2. Georg Ringer commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-09-14T15:57:14+00:00" > 09/14/26, 15:57 </span>

    closed as duplicate