From 7c12ffe0b9690c5be8f6efba5949ab0671db0867 Mon Sep 17 00:00:00 2001 From: Konrad Michalik Date: Mon, 22 Jun 2026 13:23:42 +0200 Subject: [PATCH] fix(feature): build url shortener feature url with trailing slash initUrlShortener() appended the branch directly to public_urls without a trailing slash, so DEPLOYER_CONFIG_FEATURE_URL (TYPO3_BASEURL) became "https://host/BRANCH". Consumer projects derive the site base and string- concatenated values (e.g. %env(TYPO3_BASEURL)%sitemap.xml) from it, which broke absolute URLs/breadcrumbs and caused 504 hangs. Build the URL slash-robust so it always ends with "/" regardless of whether public_urls is configured with or without a trailing slash: rtrim($publicUrl, '/') . '/' . $feature . '/'. NOTE: feature .env files are generated only once ("once generated" feature_templates). Existing feature instances must re-init (re-run feature:setup / re-generate .env) for the corrected URL to take effect. --- deployer/feature/task/url_shortener.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/deployer/feature/task/url_shortener.php b/deployer/feature/task/url_shortener.php index a7ed2cf..79cf716 100644 --- a/deployer/feature/task/url_shortener.php +++ b/deployer/feature/task/url_shortener.php @@ -4,8 +4,12 @@ tasK('feature:urlshortener', function () { - if (!input()->getOption('feature')) return; - if (!isUrlShortener()) return; + if (!input()->getOption('feature')) { + return; + } + if (!isUrlShortener()) { + return; + } $symlinkDir = get('deploy_path') . "/current/" . get('web_path'); @@ -35,7 +39,9 @@ function isUrlShortener(): bool */ function initUrlShortener(?string $feature = null): void { - if (!isUrlShortener()) return; + if (!isUrlShortener()) { + return; + } debug('Adjust host configuration because of url shortener function'); set('deploy_path_url_shortener', get('deploy_path')); @@ -43,7 +49,7 @@ function initUrlShortener(?string $feature = null): void $publicUrls = []; foreach (get('public_urls') as $publicUrl) { - $publicUrls[] = $publicUrl . $feature; + $publicUrls[] = rtrim($publicUrl, '/') . '/' . $feature . '/'; } set('public_urls', $publicUrls); }