#110619Cannot restrict "redirects:cleanup" command by domain
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
-
Wouter Wolters commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2026-09-04T19:03:29+00:00" > 09/04/26, 19:03 </span> -
Georg Ringer changed Duplicates #110620 <span data-processor="relativetime" data-value="2026-09-14T15:56:49+00:00" > 09/14/26, 15:56 </span>
-
Georg Ringer commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2026-09-14T15:57:14+00:00" > 09/14/26, 15:57 </span>closed as duplicate
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 (‘*’).