Issue Bug Rejected

#110399Redirect modules: source_host select is empty on sites without an absolute base URL

Marno Schmigotzki 08/07/26, 14:41 updated 08/14/26, 06:48

Description

When a site has a relative base (e.g. “/my-site/” instead of
“https://example.com/”), the “source_host” select in the Redirects
modules is empty. This is especially bad for “short_url” / “qrcode“
redirects, which don’t offer a “*” fallback, so the field has no selectable
value at all.

Analysis

\TYPO3\CMS\Redirects\Data\SourceHostProvider::filterAllowedSourceHosts()
reads the host via $language->getBase()->getHost(). For a relative base
this returns an empty string, which the method then discards:

if ($host !== '' && !in_array($host, $hosts, true)) {
    $hosts[] = $host;
}

So getHosts() returns an empty array for such sites, even though they are
reachable under whatever domain the request comes in on. This same method
backs RedirectPermissionGuard::getAllowedHosts(), so non-admins are also
unable to manage concrete-host redirects on these sites.

Steps to reproduce

1. Set up TYPO3 (tested with current main) with a site using a relative base,
e.g. “base: /my-site/” and default language base “/”.
2. Create a new redirect of type “Short URL” via the Redirects module.
3. The “Source host” field has no selectable entries.

Reviews 0

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

History 2

  1. Georg Ringer commented and changed status New Rejected <span data-processor="relativetime" data-value="2026-08-14T06:48:46+00:00" > 08/14/26, 06:48 </span>

    Thanks for creating the issue!

    As stated in the site config at base
    > Main URL to call the frontend in default language. Can be https://www.example.com/ or just /, if it is just a / you cannot rely on TYPO3 creating full URLs

    So I suggest using a full domain instead of just /my-site/

    Feel free to discuss on e.g. slack but I reject that issue – hope you understand