From 873e430547fcbd490c951f0644c72e5a006659b9 Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Fri, 24 Nov 2017 23:30:11 +0100
Subject: [PATCH] [TASK] Use BE Routing / PSR-7 instead of
 BackendUtility::getModuleUrl

The new PSR-7-based solution since TYPO3 v7 should be used everywhere
instead of "BackendUtility::getModuleUrl()". This is possible because
modules can be addressed via the "route" GET parameter instead of the
"M" parameter since a few months.

The patch changes all occurrences within TYPO3 Core to use the new API.

Resolves: #83172
Releases: master
Change-Id: Iec40e8ae00f1d900d7479b84a3a62827ddba653b
Reviewed-on: https://review.typo3.org/54755
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
---
 .../ToolbarItems/ClearCacheToolbarItem.php    |  7 +-
 .../ToolbarItems/ShortcutToolbarItem.php      | 10 +--
 .../SystemInformationToolbarItem.php          |  5 +-
 .../Backend/ToolbarItems/UserToolbarItem.php  |  7 +-
 .../backend/Classes/Clipboard/Clipboard.php   | 24 +++---
 .../ItemProviders/PageProvider.php            |  9 +-
 .../ItemProviders/RecordProvider.php          |  4 +-
 .../Classes/Controller/BackendController.php  | 19 +++--
 .../ElementHistoryController.php              |  5 +-
 .../ElementInformationController.php          | 16 ++--
 .../Controller/EditDocumentController.php     | 38 ++++++---
 .../File/CreateFolderController.php           | 15 +++-
 .../Controller/File/EditFileController.php    |  7 +-
 .../Controller/File/FileController.php        |  4 +-
 .../Controller/File/FileUploadController.php  |  9 +-
 .../Controller/File/RenameFileController.php  |  5 +-
 .../Controller/File/ReplaceFileController.php |  5 +-
 .../FileSystemNavigationFrameController.php   |  5 +-
 .../Classes/Controller/LoginController.php    | 14 +++-
 .../Controller/LoginFramesetController.php    |  6 +-
 .../Controller/NewRecordController.php        | 12 ++-
 .../Controller/PageLayoutController.php       | 31 +++++--
 .../Controller/Wizard/AddController.php       |  4 +-
 .../Controller/Wizard/EditController.php      | 10 ++-
 .../Controller/Wizard/ListController.php      |  4 +-
 .../Module/BackendModuleRepository.php        |  7 +-
 .../Form/Container/InlineRecordContainer.php  |  3 +-
 .../Classes/Form/FieldControl/AddRecord.php   |  6 +-
 .../Classes/Form/FieldControl/EditPopup.php   |  6 +-
 .../Classes/Form/FieldControl/LinkPopup.php   |  5 +-
 .../Classes/Form/FieldControl/ListModule.php  |  6 +-
 .../Classes/Form/FieldControl/TableWizard.php |  6 +-
 .../Classes/Form/FormResultCompiler.php       |  5 +-
 .../backend/Classes/Module/ModuleLoader.php   | 10 +--
 .../Classes/Search/LiveSearch/LiveSearch.php  |  6 +-
 .../View/ContentCreationPagePositionMap.php   |  8 +-
 .../Tree/View/PageMovingPagePositionMap.php   | 11 ++-
 .../Classes/Tree/View/PagePositionMap.php     | 31 ++++---
 .../Classes/Utility/BackendUtility.php        |  8 +-
 .../backend/Classes/View/PageLayoutView.php   | 82 ++++++++++---------
 .../ViewHelpers/ModuleLinkViewHelper.php      |  6 +-
 .../SystemInformationController.php           |  5 +-
 .../BackendUserActionController.php           | 14 ++--
 .../Controller/BackendUserController.php      |  9 +-
 .../Controller/BackendUserGroupController.php |  6 +-
 .../Classes/Hook/BackendControllerHook.php    |  5 +-
 .../Classes/Hook/SwitchBackUserHook.php       |  4 +-
 .../ViewHelpers/EditRecordViewHelper.php      |  7 +-
 .../ViewHelpers/IssueCommandViewHelper.php    |  5 +-
 .../ViewHelpers/RemoveUserViewHelper.php      |  5 +-
 .../core/Classes/Database/QueryView.php       | 11 ++-
 .../TypoScript/ExtendedTemplateService.php    | 10 ++-
 .../Classes/Controller/HelpController.php     |  5 +-
 .../Classes/Service/JavaScriptService.php     |  5 +-
 .../feedit/Classes/FrontendEditPanel.php      | 12 +--
 .../Classes/Controller/FileListController.php | 13 ++-
 typo3/sysext/filelist/Classes/FileList.php    | 32 +++++---
 .../Classes/Hook/BackendControllerHook.php    | 13 +--
 .../ViewHelpers/Uri/DeleteFileViewHelper.php  |  6 +-
 .../Uri/EditFileContentViewHelper.php         |  6 +-
 .../EditSysFileMetadataRecordViewHelper.php   |  6 +-
 .../ViewHelpers/Uri/RenameFileViewHelper.php  |  6 +-
 .../ViewHelpers/Uri/ReplaceFileViewHelper.php |  6 +-
 .../Controller/FormEditorController.php       | 10 ++-
 .../Controller/FormManagerController.php      |  4 +-
 .../frontend/Classes/View/AdminPanelView.php  | 16 ++--
 .../Controller/ImportExportController.php     |  4 +-
 .../Classes/Hook/BackendControllerHook.php    |  5 +-
 .../impexp/Classes/Task/ImportExportTask.php  | 10 ++-
 .../Controller/InfoModuleController.php       |  8 +-
 .../InfoPageTyposcriptConfigController.php    |  6 +-
 .../Controller/PageInformationController.php  |  4 +-
 .../TranslationStatusController.php           | 10 ++-
 .../Classes/Report/InstallStatusReport.php    |  6 +-
 .../Classes/Report/SecurityStatusReport.php   |  5 +-
 .../Classes/Report/LinkValidatorReport.php    |  4 +-
 .../Controller/ConfigurationController.php    |  5 +-
 .../DatabaseIntegrityController.php           | 13 ++-
 .../lowlevel/Classes/Utility/ArrayBrowser.php | 10 ++-
 .../ToolbarItems/OpendocsToolbarItem.php      |  4 +-
 .../Classes/Browser/FileBrowser.php           |  4 +-
 .../Controller/ElementBrowserController.php   |  5 +-
 .../ElementBrowserFramesetController.php      |  7 +-
 .../sysext/recordlist/Classes/RecordList.php  | 10 ++-
 .../RecordList/AbstractDatabaseRecordList.php |  4 +-
 .../Classes/RecordList/DatabaseRecordList.php | 38 ++++++---
 .../Classes/View/FolderUtilityRenderer.php    | 11 ++-
 .../Report/Status/ConfigurationStatus.php     |  4 +-
 .../Classes/Report/Status/SecurityStatus.php  |  7 +-
 .../Controller/SchedulerModuleController.php  | 13 ++-
 .../ViewHelpers/ModuleLinkViewHelper.php      |  6 +-
 .../Controller/SetupModuleController.php      | 12 ++-
 .../sysext/sys_action/Classes/ActionList.php  |  6 +-
 .../sysext/sys_action/Classes/ActionTask.php  | 29 +++++--
 .../ToolbarItems/ActionToolbarItem.php        |  5 +-
 .../ViewHelpers/DeleteLinkViewHelper.php      |  5 +-
 .../ViewHelpers/EditLinkViewHelper.php        |  5 +-
 .../Controller/TaskModuleController.php       |  8 +-
 ...mplateAnalyzerModuleFunctionController.php |  4 +-
 ...ateInformationModuleFunctionController.php | 11 ++-
 .../TypoScriptTemplateModuleController.php    | 26 ++++--
 ...eObjectBrowserModuleFunctionController.php | 10 ++-
 .../Controller/ViewModuleController.php       |  4 +-
 .../WorkspaceSelectorToolbarItem.php          |  5 +-
 .../Classes/Controller/PreviewController.php  |  6 +-
 .../Classes/Controller/ReviewController.php   | 15 +++-
 106 files changed, 676 insertions(+), 380 deletions(-)

diff --git a/typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php b/typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php
index 37b7931b4c7b..3b1b7eb1be30 100644
--- a/typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php
+++ b/typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php
@@ -14,9 +14,9 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface;
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -48,13 +48,14 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
         $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar/ClearCacheMenu');
         $backendUser = $this->getBackendUser();
 
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
         // Clear all page-related caches
         if ($backendUser->isAdmin() || $backendUser->getTSConfigVal('options.clearCache.pages')) {
             $this->cacheActions[] = [
                 'id' => 'pages',
                 'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushPageCachesTitle',
                 'description' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushPageCachesDescription',
-                'href' => BackendUtility::getModuleUrl('tce_db', ['cacheCmd' => 'pages']),
+                'href' => (string)$uriBuilder->buildUriFromRoute('tce_db', ['cacheCmd' => 'pages']),
                 'iconIdentifier' => 'actions-system-cache-clear-impact-low'
             ];
             $this->optionValues[] = 'pages';
@@ -68,7 +69,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
                 'id' => 'all',
                 'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushAllCachesTitle2',
                 'description' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushAllCachesDescription2',
-                'href' => BackendUtility::getModuleUrl('tce_db', ['cacheCmd' => 'all']),
+                'href' => (string)$uriBuilder->buildUriFromRoute('tce_db', ['cacheCmd' => 'all']),
                 'iconIdentifier' => 'actions-system-cache-clear-impact-high'
             ];
             $this->optionValues[] = 'all';
diff --git a/typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php b/typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php
index b5e48a33fe08..456346ecaece 100644
--- a/typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php
+++ b/typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Module\ModuleLoader;
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\Connection;
@@ -317,14 +318,14 @@ class ShortcutToolbarItem implements ToolbarItemInterface
         $parsedUrl = parse_url($url);
         parse_str($parsedUrl['query'], $parameters);
 
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
         // parse the returnUrl and replace the module token of it
         if (isset($parameters['returnUrl'])) {
             $parsedReturnUrl = parse_url($parameters['returnUrl']);
             parse_str($parsedReturnUrl['query'], $returnUrlParameters);
             if (strpos($parsedReturnUrl['path'], 'index.php') !== false && !empty($returnUrlParameters['route'])) {
                 $module = $returnUrlParameters['route'];
-                $returnUrl = BackendUtility::getModuleUrl($module, $returnUrlParameters);
-                $parameters['returnUrl'] = $returnUrl;
+                $parameters['returnUrl'] = (string)$uriBuilder->buildUriFromRoutePath($module, $returnUrlParameters);
                 $url = $parsedUrl['path'] . '?' . http_build_query($parameters, '', '&', PHP_QUERY_RFC3986);
             }
         }
@@ -334,9 +335,6 @@ class ShortcutToolbarItem implements ToolbarItemInterface
         }
 
         if (strpos($parsedUrl['path'], 'index.php') !== false && isset($parameters['route'])) {
-            $module = $parameters['route'];
-            $url = BackendUtility::getModuleUrl($module, $parameters);
-        } elseif (strpos($parsedUrl['path'], 'index.php') !== false && isset($parameters['route'])) {
             $routePath = $parameters['route'];
             /** @var \TYPO3\CMS\Backend\Routing\Router $router */
             $router = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\Router::class);
@@ -344,8 +342,6 @@ class ShortcutToolbarItem implements ToolbarItemInterface
                 $route = $router->match($routePath);
                 if ($route) {
                     $routeIdentifier = $route->getOption('_identifier');
-                    /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
-                    $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
                     unset($parameters['route']);
                     $url = (string)$uriBuilder->buildUriFromRoute($routeIdentifier, $parameters);
                 }
diff --git a/typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php b/typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php
index 7d12140fe37f..c57201af0d8e 100644
--- a/typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php
+++ b/typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php
@@ -16,9 +16,9 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus;
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -346,9 +346,10 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
             return '';
         }
 
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
         $view = $this->getFluidTemplateObject('SystemInformationDropDown.html');
         $view->assignMultiple([
-            'environmentToolUrl' => BackendUtility::getModuleUrl('tools_toolsenvironment'),
+            'environmentToolUrl' => (string)$uriBuilder->buildUriFromRoute('tools_toolsenvironment'),
             'messages' => $this->systemMessages,
             'count' => $this->totalCount > $this->maximumCountInBadge ? $this->maximumCountInBadge . '+' : $this->totalCount,
             'severityBadgeClass' => $this->severityBadgeClass,
diff --git a/typo3/sysext/backend/Classes/Backend/ToolbarItems/UserToolbarItem.php b/typo3/sysext/backend/Classes/Backend/ToolbarItems/UserToolbarItem.php
index 4b36257c9594..0eec6d94c95c 100644
--- a/typo3/sysext/backend/Classes/Backend/ToolbarItems/UserToolbarItem.php
+++ b/typo3/sysext/backend/Classes/Backend/ToolbarItems/UserToolbarItem.php
@@ -15,8 +15,8 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
  */
 
 use TYPO3\CMS\Backend\Domain\Repository\Module\BackendModuleRepository;
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
@@ -65,6 +65,7 @@ class UserToolbarItem implements ToolbarItemInterface
 
         /** @var BackendModuleRepository $backendModuleRepository */
         $backendModuleRepository = GeneralUtility::makeInstance(BackendModuleRepository::class);
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
 
         $mostRecentUsers = [];
         if (ExtensionManagementUtility::isLoaded('beuser')
@@ -85,7 +86,7 @@ class UserToolbarItem implements ToolbarItemInterface
             $mostRecentUsers = array_flip($backendUser->uc['recentSwitchedToUsers']);
 
             while ($row = $result->fetch()) {
-                $row['switchUserLink'] = BackendUtility::getModuleUrl(
+                $row['switchUserLink'] = (string)$uriBuilder->buildUriFromRoute(
                     'system_BeuserTxBeuser',
                     [
                         'SwitchUser' => $row['uid']
@@ -110,7 +111,7 @@ class UserToolbarItem implements ToolbarItemInterface
         $view = $this->getFluidTemplateObject('UserToolbarItemDropDown.html');
         $view->assignMultiple([
             'modules' => $backendModuleRepository->findByModuleName('user')->getChildren(),
-            'logoutUrl' => BackendUtility::getModuleUrl('logout'),
+            'logoutUrl' => (string)$uriBuilder->buildUriFromRoute('logout'),
             'switchUserMode' => $this->getBackendUser()->user['ses_backuserid'],
             'recentUsers' => $mostRecentUsers,
         ]);
diff --git a/typo3/sysext/backend/Classes/Clipboard/Clipboard.php b/typo3/sysext/backend/Classes/Clipboard/Clipboard.php
index a5867f9f6001..e31a07235432 100644
--- a/typo3/sysext/backend/Classes/Clipboard/Clipboard.php
+++ b/typo3/sysext/backend/Classes/Clipboard/Clipboard.php
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Backend\Clipboard;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
@@ -270,10 +271,11 @@ class Clipboard
             $optionArray = [];
             // Import / Export link:
             if (ExtensionManagementUtility::isLoaded('impexp')) {
-                $url = BackendUtility::getModuleUrl('xMOD_tximpexp', $this->exportClipElementParameters());
+                $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                $url = $uriBuilder->buildUriFromRoute('xMOD_tximpexp', $this->exportClipElementParameters());
                 $optionArray[] = [
                     'label' => $this->clLabel('export', 'rm'),
-                    'uri' => $url
+                    'uri' => (string)$url
                 ];
             }
             // Edit:
@@ -541,19 +543,18 @@ class Clipboard
      */
     public function linkItemText($str, $rec, $table = '')
     {
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
         if (is_array($rec) && $table) {
             if ($this->fileMode) {
                 $str = '<span class="text-muted">' . $str . '</span>';
             } else {
-                $str = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_list', ['id' => $rec['pid']])) . '">' . $str . '</a>';
+                $str = '<a href="' . htmlspecialchars((string)$uriBuilder->buildUriFromRoute('web_list', ['id' => $rec['pid']])) . '">' . $str . '</a>';
             }
         } elseif (file_exists($rec)) {
             if (!$this->fileMode) {
                 $str = '<span class="text-muted">' . $str . '</span>';
-            } else {
-                if (ExtensionManagementUtility::isLoaded('filelist')) {
-                    $str = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('file_list', ['id' => dirname($rec)])) . '">' . $str . '</a>';
-                }
+            } elseif (ExtensionManagementUtility::isLoaded('filelist')) {
+                $str = '<a href="' . htmlspecialchars((string)$uriBuilder->buildUriFromRoute('file_list', ['id' => dirname($rec)])) . '">' . $str . '</a>';
             }
         }
         return $str;
@@ -621,7 +622,8 @@ class Clipboard
         if (is_array($update)) {
             $urlParameters['CB[update]'] = $update;
         }
-        return BackendUtility::getModuleUrl($table === '_FILE' ? 'tce_file' : 'tce_db', $urlParameters);
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute($table === '_FILE' ? 'tce_file' : 'tce_db', $urlParameters);
     }
 
     /**
@@ -640,7 +642,8 @@ class Clipboard
         if ($setRedirect) {
             $urlParameters['redirect'] = GeneralUtility::linkThisScript(['CB' => '']);
         }
-        return BackendUtility::getModuleUrl($file ? 'tce_file' : 'tce_db', $urlParameters);
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute($file ? 'tce_file' : 'tce_db', $urlParameters);
     }
 
     /**
@@ -659,7 +662,8 @@ class Clipboard
             list($table, $uid) = explode('|', $tP);
             $parameters['edit[' . $table . '][' . $uid . ']'] = 'edit';
         }
-        return BackendUtility::getModuleUrl('record_edit', $parameters);
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
     }
 
     /**
diff --git a/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php b/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php
index 85d0ce7f09de..b414ec1cec3a 100644
--- a/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php
+++ b/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php
@@ -15,8 +15,9 @@ namespace TYPO3\CMS\Backend\ContextMenu\ItemProviders;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Core\Type\Bitmask\Permission;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * Context menu item provider for pages table
@@ -453,13 +454,15 @@ class PageProvider extends RecordProvider
             $attributes += $this->getPasteAdditionalAttributes('after');
         }
         if ($itemName === 'pagesSort') {
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
             $attributes += [
-                'data-pages-sort-url' => BackendUtility::getModuleUrl('pages_sort', ['id' => $this->record['uid']]),
+                'data-pages-sort-url' => (string)$uriBuilder->buildUriFromRoute('pages_sort', ['id' => $this->record['uid']]),
             ];
         }
         if ($itemName === 'pagesNewMultiple') {
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
             $attributes += [
-                'data-pages-new-multiple-url' => BackendUtility::getModuleUrl('pages_new', ['id' => $this->record['uid']]),
+                'data-pages-new-multiple-url' => (string)$uriBuilder->buildUriFromRoute('pages_new', ['id' => $this->record['uid']]),
             ];
         }
         return $attributes;
diff --git a/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php b/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php
index 0992c38012ba..f349451532e3 100644
--- a/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php
+++ b/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Backend\ContextMenu\ItemProviders;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
 use TYPO3\CMS\Core\Type\Bitmask\Permission;
@@ -302,7 +303,8 @@ class RecordProvider extends AbstractProvider
                 'colPos' => $this->record['colPos'],
                 'uid_pid' => -$this->record['uid']
             ];
-            $url = BackendUtility::getModuleUrl($moduleName, $urlParameters);
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+            $url = (string)$uriBuilder->buildUriFromRoute($moduleName, $urlParameters);
             $attributes += [
                 'data-new-wizard-url' => htmlspecialchars($url)
             ];
diff --git a/typo3/sysext/backend/Classes/Controller/BackendController.php b/typo3/sysext/backend/Classes/Controller/BackendController.php
index 224ef97cc4eb..6bebb66f924f 100644
--- a/typo3/sysext/backend/Classes/Controller/BackendController.php
+++ b/typo3/sysext/backend/Classes/Controller/BackendController.php
@@ -18,6 +18,7 @@ use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Domain\Repository\Module\BackendModuleRepository;
 use TYPO3\CMS\Backend\Module\ModuleLoader;
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -112,7 +113,7 @@ class BackendController
 
         $this->backendModuleRepository = GeneralUtility::makeInstance(BackendModuleRepository::class);
         $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
-
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
         // Set debug flag for BE development only
         $this->debug = (int)$GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1;
         // Initializes the backend modules structure for use later.
@@ -131,8 +132,8 @@ class BackendController
         ];
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LoginRefresh', 'function(LoginRefresh) {
 			LoginRefresh.setIntervalTime(' . MathUtility::forceIntegerInRange((int)$GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout'] - 60, 60) . ');
-			LoginRefresh.setLoginFramesetUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('login_frameset')) . ');
-			LoginRefresh.setLogoutUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('logout')) . ');
+			LoginRefresh.setLoginFramesetUrl(' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('login_frameset')) . ');
+			LoginRefresh.setLogoutUrl(' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('logout')) . ');
 			LoginRefresh.initialize();
 		}');
 
@@ -166,12 +167,12 @@ class BackendController
         $this->pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_core.xlf');
         $this->pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_misc.xlf');
 
-        $this->pageRenderer->addInlineSetting('ShowItem', 'moduleUrl', BackendUtility::getModuleUrl('show_item'));
-        $this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', BackendUtility::getModuleUrl('record_history'));
-        $this->pageRenderer->addInlineSetting('NewRecord', 'moduleUrl', BackendUtility::getModuleUrl('db_new'));
-        $this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', BackendUtility::getModuleUrl('record_edit'));
-        $this->pageRenderer->addInlineSetting('RecordCommit', 'moduleUrl', BackendUtility::getModuleUrl('tce_db'));
-        $this->pageRenderer->addInlineSetting('WebLayout', 'moduleUrl', BackendUtility::getModuleUrl('web_layout'));
+        $this->pageRenderer->addInlineSetting('ShowItem', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('show_item'));
+        $this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('record_history'));
+        $this->pageRenderer->addInlineSetting('NewRecord', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('db_new'));
+        $this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('record_edit'));
+        $this->pageRenderer->addInlineSetting('RecordCommit', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('tce_db'));
+        $this->pageRenderer->addInlineSetting('WebLayout', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('web_layout'));
 
         $this->css = '';
 
diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php
index de3a8dc0b6d7..0b354ad503d2 100644
--- a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php
+++ b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php
@@ -417,7 +417,10 @@ class ElementHistoryController
         // Merging overriding values:
         $params = array_merge($params, $overrideParameters);
         // Make the link:
-        return BackendUtility::getModuleUrl('record_history', $params);
+
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('record_history', $params);
     }
 
     /**
diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
index 5983a06dbd96..00313ed4aeb4 100644
--- a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
+++ b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
@@ -497,18 +497,20 @@ class ElementInformationController
             ],
             'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
         ];
-        $actions['recordEditUrl'] = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $actions['recordEditUrl'] = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
 
         // History button
         $urlParameters = [
             'element' => $table . ':' . $uid,
             'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
         ];
-        $actions['recordHistoryUrl'] = BackendUtility::getModuleUrl('record_history', $urlParameters);
+        $actions['recordHistoryUrl'] = (string)$uriBuilder->buildUriFromRoute('record_history', $urlParameters);
 
         if ($table === 'pages') {
             // Recordlist button
-            $actions['webListUrl'] = BackendUtility::getModuleUrl('web_list', ['id' => $uid, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]);
+            $actions['webListUrl'] = (string)$uriBuilder->buildUriFromRoute('web_list', ['id' => $uid, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]);
 
             // View page button
             $actions['viewOnClick'] = BackendUtility::viewOnClick($uid, '', BackendUtility::BEgetRootLine($uid));
@@ -582,7 +584,9 @@ class ElementInformationController
                     ],
                     'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                 ];
-                $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+                $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                 $line['url'] = $url;
                 $line['icon'] = $this->iconFactory->getIconForRecord($row['tablename'], $record, Icon::SIZE_SMALL)->render();
                 $line['row'] = $row;
@@ -646,7 +650,9 @@ class ElementInformationController
                     ],
                     'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                 ];
-                $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+                $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                 $line['url'] = $url;
                 $line['icon'] = $this->iconFactory->getIconForRecord($row['tablename'], $record, Icon::SIZE_SMALL)->render();
                 $line['row'] = $row;
diff --git a/typo3/sysext/backend/Classes/Controller/EditDocumentController.php b/typo3/sysext/backend/Classes/Controller/EditDocumentController.php
index bb4e716c96ea..c19f49302aec 100644
--- a/typo3/sysext/backend/Classes/Controller/EditDocumentController.php
+++ b/typo3/sysext/backend/Classes/Controller/EditDocumentController.php
@@ -462,8 +462,10 @@ class EditDocumentController
         if (!is_array($this->defVals) && is_array($this->overrideVals)) {
             $this->defVals = $this->overrideVals;
         }
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Setting return URL
-        $this->retUrl = $this->returnUrl ?: BackendUtility::getModuleUrl('dummy');
+        $this->retUrl = $this->returnUrl ?: (string)$uriBuilder->buildUriFromRoute('dummy');
         // Fix $this->editconf if versioning applies to any of the records
         $this->fixWSversioningInEditConf();
         // Make R_URL (request url) based on input GETvars:
@@ -607,10 +609,12 @@ class EditDocumentController
                                 }
                                 $newEditConf[$tableName][$editId] = 'edit';
                             }
+                            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
                             // Traverse all new records and forge the content of ->editconf so we can continue to EDIT
                             // these records!
                             if ($tableName === 'pages'
-                                && $this->retUrl != BackendUtility::getModuleUrl('dummy')
+                                && $this->retUrl != (string)$uriBuilder->buildUriFromRoute('dummy')
                                 && $this->returnNewPageId
                             ) {
                                 $this->retUrl .= '&id=' . $tce->substNEWwithIDs[$key];
@@ -728,6 +732,8 @@ class EditDocumentController
         $this->doc = $GLOBALS['TBE_TEMPLATE'];
         $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
         $pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_alt_doc.xlf');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // override the default jumpToUrl
         $this->moduleTemplate->addJavaScriptCode(
             'jumpToUrl',
@@ -743,7 +749,7 @@ class EditDocumentController
 				// Info view:
 			function launchView(table,uid) {
 				var thePreviewWindow = window.open(
-					' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('show_item') . '&table=') . ' + encodeURIComponent(table) + "&uid=" + encodeURIComponent(uid),
+					' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('show_item') . '&table=') . ' + encodeURIComponent(table) + "&uid=" + encodeURIComponent(uid),
 					"ShowItem" + Math.random().toString(16).slice(2),
 					"height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0"
 				);
@@ -752,7 +758,7 @@ class EditDocumentController
 				}
 			}
 			function deleteRecord(table,id,url) {
-				window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url);
+				window.location.href = ' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url);
 			}
 		' . (isset($_POST['_savedokview']) && $this->popViewId ? $this->generatePreviewCode() : '')
         );
@@ -1154,6 +1160,8 @@ class EditDocumentController
     protected function getButtons()
     {
         $lang = $this->getLanguageService();
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Render SAVE type buttons:
         // The action of each button is decided by its name attribute. (See doProcessData())
         $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
@@ -1282,7 +1290,7 @@ class EditDocumentController
                         ) {
                             // TODO: Use the page's pid instead of 0, this requires a clean API to manipulate the page
                             // tree from the outside to be able to mark the pid as active
-                            $returnUrl = BackendUtility::getModuleUrl($queryParams['route'], ['id' => 0]);
+                            $returnUrl = (string)$uriBuilder->buildUriFromRoute($queryParams['route'], ['id' => 0]);
                         }
                     }
                     $deleteButton = $buttonBar->makeLinkButton()
@@ -1324,7 +1332,7 @@ class EditDocumentController
                 if ($undoButtonR !== false) {
                     $aOnClick = 'window.location.href=' .
                         GeneralUtility::quoteJSvalue(
-                            BackendUtility::getModuleUrl(
+                            (string)$uriBuilder->buildUriFromRoute(
                                 'record_history',
                                 [
                                     'element' => $this->firstEl['table'] . ':' . $this->firstEl['uid'],
@@ -1355,7 +1363,7 @@ class EditDocumentController
                 if ($this->getNewIconMode($this->firstEl['table'], 'showHistory')) {
                     $aOnClick = 'window.location.href=' .
                         GeneralUtility::quoteJSvalue(
-                            BackendUtility::getModuleUrl(
+                            (string)$uriBuilder->buildUriFromRoute(
                                 'record_history',
                                 [
                                     'element' => $this->firstEl['table'] . ':' . $this->firstEl['uid'],
@@ -1505,6 +1513,9 @@ class EditDocumentController
     {
         $languageField = $GLOBALS['TCA'][$table]['ctrl']['languageField'];
         $transOrigPointerField = $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'];
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         // Table editable and activated for languages?
         if ($this->getBackendUser()->check('tables_modify', $table)
             && $languageField
@@ -1593,7 +1604,7 @@ class EditDocumentController
                             // Create url for creating a localized record
                             $addOption = true;
                             if ($newTranslation) {
-                                $redirectUrl = BackendUtility::getModuleUrl('record_edit', [
+                                $redirectUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                                     'justLocalized' => $table . ':' . $rowsByLang[0]['uid'] . ':' . $lang['uid'],
                                     'returnUrl' => $this->retUrl
                                 ]);
@@ -1607,7 +1618,7 @@ class EditDocumentController
                                     $addOption = false;
                                 }
                             } else {
-                                $href = BackendUtility::getModuleUrl('record_edit', [
+                                $href = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                                     'edit[' . $table . '][' . $rowsByLang[$lang['uid']]['uid'] . ']' => 'edit',
                                     'returnUrl' => $this->retUrl
                                 ]);
@@ -1636,6 +1647,9 @@ class EditDocumentController
      */
     public function localizationRedirect($justLocalized)
     {
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         list($table, $origUid, $language) = explode(':', $justLocalized);
         if ($GLOBALS['TCA'][$table]
             && $GLOBALS['TCA'][$table]['ctrl']['languageField']
@@ -1665,7 +1679,7 @@ class EditDocumentController
 
             if (is_array($localizedRecord)) {
                 // Create parameters and finally run the classic page module for creating a new page translation
-                $location = BackendUtility::getModuleUrl('record_edit', [
+                $location = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                     'edit[' . $table . '][' . $localizedRecord['uid'] . ']' => 'edit',
                     'returnUrl' => GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl'))
                 ]);
@@ -1900,9 +1914,11 @@ class EditDocumentController
             BackendUtility::setUpdateSignal('OpendocsController::updateNumber', count($this->docHandler));
         }
         if ($mode !== self::DOCUMENT_CLOSE_MODE_NO_REDIRECT) {
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
             // If ->returnEditConf is set, then add the current content of editconf to the ->retUrl variable: (used by
             // other scripts, like wizard_add, to know which records was created or so...)
-            if ($this->returnEditConf && $this->retUrl != BackendUtility::getModuleUrl('dummy')) {
+            if ($this->returnEditConf && $this->retUrl != (string)$uriBuilder->buildUriFromRoute('dummy')) {
                 $this->retUrl .= '&returnEditConf=' . rawurlencode(json_encode($this->editconf));
             }
 
diff --git a/typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php b/typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php
index ffc74c2b9907..eb6705071472 100644
--- a/typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php
+++ b/typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php
@@ -131,6 +131,9 @@ class CreateFolderController
         $pathInfo = [
             'combined_identifier' => $this->folderObject->getCombinedIdentifier(),
         ];
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($pathInfo);
         $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
         $this->moduleTemplate->addJavaScriptCode(
@@ -148,7 +151,7 @@ class CreateFolderController
             . ';
             function reload(a) {
                 var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl=' . rawurlencode($this->returnUrl) . '";
-                var url = \'' . BackendUtility::getModuleUrl('file_newfolder') . '\';
+                var url = \'' . (string)$uriBuilder->buildUriFromRoute('file_newfolder') . '\';
                 if (!changed) {
                     window.location.href = url + params;
                 } else {
@@ -178,7 +181,9 @@ class CreateFolderController
         $assigns = [];
         $assigns['target'] = $this->target;
         if ($this->folderObject->checkActionPermission('add')) {
-            $assigns['moduleUrlTceFile'] = BackendUtility::getModuleUrl('tce_file');
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $assigns['moduleUrlTceFile'] = (string)$uriBuilder->buildUriFromRoute('tce_file');
             $assigns['cshFileNewFolder'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfolder');
             // Making the selector box for the number of concurrent folder-creations
             $this->number = MathUtility::forceIntegerInRange($this->number, 1, 10);
@@ -200,7 +205,9 @@ class CreateFolderController
         }
 
         if ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File')) {
-            $assigns['moduleUrlOnlineMedia'] = BackendUtility::getModuleUrl('online_media');
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $assigns['moduleUrlOnlineMedia'] = (string)$uriBuilder->buildUriFromRoute('online_media');
             $assigns['cshFileNewMedia'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_newMedia');
             // Create a list of allowed file extensions with the readable format "youtube, vimeo" etc.
             $fileExtList = [];
@@ -212,7 +219,7 @@ class CreateFolderController
             }
             $assigns['fileExtList'] = $fileExtList;
 
-            $assigns['moduleUrlTceFile'] = BackendUtility::getModuleUrl('tce_file');
+            $assigns['moduleUrlTceFile'] = (string)$uriBuilder->buildUriFromRoute('tce_file');
             $assigns['cshFileNewFile'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfile');
             // Create a list of allowed file extensions with a text format "*.txt, *.css" etc.
             $fileExtList = [];
diff --git a/typo3/sysext/backend/Classes/Controller/File/EditFileController.php b/typo3/sysext/backend/Classes/Controller/File/EditFileController.php
index ef5d9c6a5234..7df8db6278d9 100644
--- a/typo3/sysext/backend/Classes/Controller/File/EditFileController.php
+++ b/typo3/sysext/backend/Classes/Controller/File/EditFileController.php
@@ -21,7 +21,6 @@ use TYPO3\CMS\Backend\Form\NodeFactory;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
@@ -177,7 +176,9 @@ class EditFileController
         }
 
         $assigns = [];
-        $assigns['moduleUrlTceFile'] = BackendUtility::getModuleUrl('tce_file');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $assigns['moduleUrlTceFile'] = (string)$uriBuilder->buildUriFromRoute('tce_file');
         $assigns['fileName'] = $this->fileObject->getName();
 
         $extList = $GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'];
@@ -187,7 +188,7 @@ class EditFileController
             }
 
             // Making the formfields
-            $hValue = BackendUtility::getModuleUrl('file_edit', [
+            $hValue = (string)$uriBuilder->buildUriFromRoute('file_edit', [
                 'target' => $this->origTarget,
                 'returnUrl' => $this->returnUrl
             ]);
diff --git a/typo3/sysext/backend/Classes/Controller/File/FileController.php b/typo3/sysext/backend/Classes/Controller/File/FileController.php
index a9ec9cdada08..e7ef88e8b5f0 100644
--- a/typo3/sysext/backend/Classes/Controller/File/FileController.php
+++ b/typo3/sysext/backend/Classes/Controller/File/FileController.php
@@ -187,7 +187,9 @@ class FileController
             if ($this->redirect) {
                 $urlParameters['returnUrl'] = $this->redirect;
             }
-            $this->redirect = BackendUtility::getModuleUrl('file_edit', $urlParameters);
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $this->redirect = (string)$uriBuilder->buildUriFromRoute('file_edit', $urlParameters);
         }
         if ($this->redirect) {
             return $response
diff --git a/typo3/sysext/backend/Classes/Controller/File/FileUploadController.php b/typo3/sysext/backend/Classes/Controller/File/FileUploadController.php
index eced801dfd51..f1e73b5ee600 100644
--- a/typo3/sysext/backend/Classes/Controller/File/FileUploadController.php
+++ b/typo3/sysext/backend/Classes/Controller/File/FileUploadController.php
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Backend\Controller\File;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
@@ -88,11 +87,13 @@ class FileUploadController
      */
     protected function init()
     {
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Initialize GPvars:
         $this->target = GeneralUtility::_GP('target');
         $this->returnUrl = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl'));
         if (!$this->returnUrl) {
-            $this->returnUrl = BackendUtility::getModuleUrl('file_list', [
+            $this->returnUrl = (string)$uriBuilder->buildUriFromRoute('file_list', [
                 'id' => rawurlencode($this->target)
             ]);
         }
@@ -131,12 +132,14 @@ class FileUploadController
     public function main()
     {
         $lang = $this->getLanguageService();
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
 
         // set page title
         $this->moduleTemplate->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_upload.php.pagetitle'));
 
         $pageContent = '<form action="'
-            . htmlspecialchars(BackendUtility::getModuleUrl('tce_file'))
+            . htmlspecialchars((string)$uriBuilder->buildUriFromRoute('tce_file'))
             . '" method="post" id="FileUploadController" name="editform" enctype="multipart/form-data">';
         // Make page header:
         $pageContent .= '<h1>' . $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_upload.php.pagetitle') . '</h1>';
diff --git a/typo3/sysext/backend/Classes/Controller/File/RenameFileController.php b/typo3/sysext/backend/Classes/Controller/File/RenameFileController.php
index a3cf17c63073..d5fa13f3dcf8 100644
--- a/typo3/sysext/backend/Classes/Controller/File/RenameFileController.php
+++ b/typo3/sysext/backend/Classes/Controller/File/RenameFileController.php
@@ -18,7 +18,6 @@ use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Resource\DuplicationBehavior;
 use TYPO3\CMS\Core\Resource\File;
@@ -147,7 +146,9 @@ class RenameFileController
     public function main()
     {
         $assigns = [];
-        $assigns['moduleUrlTceFile'] = BackendUtility::getModuleUrl('tce_file');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $assigns['moduleUrlTceFile'] = (string)$uriBuilder->buildUriFromRoute('tce_file');
         $assigns['returnUrl'] = $this->returnUrl;
 
         if ($this->fileOrFolderObject instanceof Folder) {
diff --git a/typo3/sysext/backend/Classes/Controller/File/ReplaceFileController.php b/typo3/sysext/backend/Classes/Controller/File/ReplaceFileController.php
index a6a1c957dfcc..2e7dddff71fb 100644
--- a/typo3/sysext/backend/Classes/Controller/File/ReplaceFileController.php
+++ b/typo3/sysext/backend/Classes/Controller/File/ReplaceFileController.php
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Backend\Controller\File;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException;
@@ -154,7 +153,9 @@ class ReplaceFileController
     {
         // Assign variables used by the fluid template
         $assigns = [];
-        $assigns['moduleUrlTceFile'] = BackendUtility::getModuleUrl('tce_file');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $assigns['moduleUrlTceFile'] = (string)$uriBuilder->buildUriFromRoute('tce_file');
         $assigns['uid'] = $this->uid;
         $assigns['returnUrl'] = $this->returnUrl;
 
diff --git a/typo3/sysext/backend/Classes/Controller/FileSystemNavigationFrameController.php b/typo3/sysext/backend/Classes/Controller/FileSystemNavigationFrameController.php
index 9e999ed02bbc..143c87810b83 100644
--- a/typo3/sysext/backend/Classes/Controller/FileSystemNavigationFrameController.php
+++ b/typo3/sysext/backend/Classes/Controller/FileSystemNavigationFrameController.php
@@ -16,10 +16,10 @@ namespace TYPO3\CMS\Backend\Controller;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -121,8 +121,9 @@ class FileSystemNavigationFrameController
                 $this->foldertree->setLinkParameterProvider($linkParamProvider);
             }
         } else {
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
             $this->foldertree = GeneralUtility::makeInstance(FileListFolderTree::class);
-            $this->foldertree->thisScript = BackendUtility::getModuleUrl('file_navframe');
+            $this->foldertree->thisScript = (string)$uriBuilder->buildUriFromRoute('file_navframe');
         }
     }
 
diff --git a/typo3/sysext/backend/Classes/Controller/LoginController.php b/typo3/sysext/backend/Classes/Controller/LoginController.php
index b2d9ad069414..ee78ab0d4b21 100644
--- a/typo3/sysext/backend/Classes/Controller/LoginController.php
+++ b/typo3/sysext/backend/Classes/Controller/LoginController.php
@@ -18,6 +18,7 @@ use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Exception;
 use TYPO3\CMS\Backend\LoginProvider\LoginProviderInterface;
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -116,7 +117,12 @@ class LoginController
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_login.xlf');
 
         // Setting the redirect URL to "index.php?M=main" if no alternative input is given
-        $this->redirectToURL = $this->redirectUrl ?: BackendUtility::getModuleUrl('main');
+        if ($this->redirectUrl) {
+            $this->redirectToURL = $this->redirectUrl;
+        } else {
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+            $this->redirectToURL = (string)$uriBuilder->buildUriFromRoute('main');
+        }
 
         // If "L" is "OUT", then any logged in is logged out. If redirect_url is given, we redirect to it
         if (GeneralUtility::_GP('L') === 'OUT' && is_object($this->getBackendUserAuthentication())) {
@@ -291,7 +297,8 @@ class LoginController
                     break;
                 case 'backend':
                     $interface = 'backend';
-                    $this->redirectToURL = BackendUtility::getModuleUrl('main');
+                    $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                    $this->redirectToURL = (string)$uriBuilder->buildUriFromRoute('main');
                     break;
                 default:
                     $interface = '';
@@ -333,10 +340,11 @@ class LoginController
             $parts = GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces']);
             if (count($parts) > 1) {
                 // Only if more than one interface is defined we will show the selector
+                $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
                 $interfaces = [
                     'backend' => [
                         'label' => $this->getLanguageService()->getLL('interface.backend'),
-                        'jumpScript' => BackendUtility::getModuleUrl('main'),
+                        'jumpScript' => (string)$uriBuilder->buildUriFromRoute('main'),
                         'interface' => 'backend'
                     ],
                     'frontend' => [
diff --git a/typo3/sysext/backend/Classes/Controller/LoginFramesetController.php b/typo3/sysext/backend/Classes/Controller/LoginFramesetController.php
index 5c3e0df3433a..cb1baf950125 100644
--- a/typo3/sysext/backend/Classes/Controller/LoginFramesetController.php
+++ b/typo3/sysext/backend/Classes/Controller/LoginFramesetController.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -61,12 +60,13 @@ class LoginFramesetController
     {
         $title = 'TYPO3 Re-Login (' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . ')';
         $this->getDocumentTemplate()->startPage($title);
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Create the frameset for the window
         $this->content = $this->getPageRenderer()->render(PageRenderer::PART_HEADER) . '
 			<frameset rows="*,1">
 				<frame name="login" src="index.php?loginRefresh=1" marginwidth="0" marginheight="0" scrolling="no" noresize="noresize" />
-				<frame name="dummy" src="' . htmlspecialchars(BackendUtility::getModuleUrl('dummy')) . '" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" />
+				<frame name="dummy" src="' . htmlspecialchars((string)$uriBuilder->buildUriFromRoute('dummy')) . '" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" />
 			</frameset>
 		</html>';
     }
diff --git a/typo3/sysext/backend/Classes/Controller/NewRecordController.php b/typo3/sysext/backend/Classes/Controller/NewRecordController.php
index 1fd33451a7b6..95f04613b591 100644
--- a/typo3/sysext/backend/Classes/Controller/NewRecordController.php
+++ b/typo3/sysext/backend/Classes/Controller/NewRecordController.php
@@ -423,6 +423,8 @@ class NewRecordController
                 $this->returnUrl
             );
         } else {
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
             // No pages yet, no need to prompt for position, redirect to page creation.
             $urlParameters = [
                 'edit' => [
@@ -431,9 +433,9 @@ class NewRecordController
                     ]
                 ],
                 'returnNewPageId' => 1,
-                'returnUrl' => BackendUtility::getModuleUrl('db_new', ['id' => $this->id, 'pagesOnly' => '1'])
+                'returnUrl' => (string)$uriBuilder->buildUriFromRoute('db_new', ['id' => $this->id, 'pagesOnly' => '1'])
             ];
-            $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+            $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
             @ob_end_clean();
             HttpUtility::redirect($url);
         }
@@ -507,6 +509,8 @@ class NewRecordController
         } else {
             $rowContent = '<ul class="list-tree"><li><ul>' . $rowContent . '</li></ul>';
         }
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Compile table row
         $startRows = [$rowContent];
         $iconFile = [];
@@ -541,7 +545,7 @@ class NewRecordController
                             $moduleName = isset($tsConfig['properties']['newContentElementWizard.']['override'])
                                 ? $tsConfig['properties']['newContentElementWizard.']['override']
                                 : 'new_content_element_wizard';
-                            $url = BackendUtility::getModuleUrl($moduleName, ['id' => $this->id, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]);
+                            $url = (string)$uriBuilder->buildUriFromRoute($moduleName, ['id' => $this->id, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]);
                             $rowContent .= '<li>' . $newLink . ' ' . BackendUtility::wrapInHelp($table, '') . '</li>'
                                 . '<li>'
                                 . '<a href="#" data-url="' . htmlspecialchars($url) . '" data-title="' . htmlspecialchars($this->getLanguageService()->getLL('newContentElement')) . '" class="t3js-toggle-new-content-element-wizard">'
@@ -686,7 +690,7 @@ class NewRecordController
         } elseif ($table === 'pages') {
             $urlParameters['overrideVals']['pages']['doktype'] = (int)$this->pageinfo['doktype'];
         }
-        $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+        $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
         return '<a href="' . htmlspecialchars($url) . '">' . $linkText . '</a>';
     }
 
diff --git a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php
index fd4ecd129f87..5e2f3a4722fd 100644
--- a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php
+++ b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php
@@ -438,13 +438,16 @@ class PageLayoutController
         $actionMenu->setIdentifier('actionMenu');
         $actionMenu->setLabel('');
 
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         $defaultKey = null;
         $foundDefaultKey = false;
         foreach ($actions as $key => $action) {
             $menuItem = $actionMenu
                 ->makeMenuItem()
                 ->setTitle($action)
-                ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&SET[function]=' . $key);
+                ->setHref((string)$uriBuilder->buildUriFromRoute($this->moduleName) . '&id=' . $this->id . '&SET[function]=' . $key);
 
             if (!$foundDefaultKey) {
                 $defaultKey = $key;
@@ -712,6 +715,10 @@ class PageLayoutController
                     }
                 }
             ');
+
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
             $this->moduleTemplate->addJavaScriptCode('mainJsFunctions', '
                 if (top.fsMod) {
                     top.fsMod.recentIds["web"] = ' . (int)$this->id . ';
@@ -719,7 +726,7 @@ class PageLayoutController
                 }
                 ' . ($this->popView ? BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)) : '') . '
                 function deleteRecord(table,id,url) {   //
-                    window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[')
+                    window.location.href = ' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('tce_db') . '&cmd[')
                                              . ' + table + "][" + id + "][delete]=1&redirect=" + encodeURIComponent(url);
                     return false;
                 }
@@ -752,7 +759,7 @@ class PageLayoutController
 
             // Render the primary module content:
             if ($this->MOD_SETTINGS['function'] == 1 || $this->MOD_SETTINGS['function'] == 2) {
-                $content .= '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->id, 'imagemode' =>  $this->imagemode])) . '" id="PageLayoutController" method="post">';
+                $content .= '<form action="' . htmlspecialchars((string)$uriBuilder->buildUriFromRoute($this->moduleName, ['id' => $this->id, 'imagemode' =>  $this->imagemode])) . '" id="PageLayoutController" method="post">';
                 // Page title
                 $content .= '<h1 class="t3js-title-inlineedit">' . htmlspecialchars($this->getLocalizedPageTitle()) . '</h1>';
                 // All other listings
@@ -800,6 +807,9 @@ class PageLayoutController
      */
     public function renderContent()
     {
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         $this->moduleTemplate->getPageRenderer()->loadJquery();
         $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
         /** @var $dbList \TYPO3\CMS\Backend\View\PageLayoutView */
@@ -808,7 +818,7 @@ class PageLayoutController
         $dbList->no_noWrap = 1;
         $dbList->descrTable = $this->descrTable;
         $this->pointer = MathUtility::forceIntegerInRange($this->pointer, 0, 100000);
-        $dbList->script = BackendUtility::getModuleUrl($this->moduleName);
+        $dbList->script = (string)$uriBuilder->buildUriFromRoute($this->moduleName);
         $dbList->showIcon = 0;
         $dbList->setLMargin = 0;
         $dbList->doEdit = $this->EDIT_CONTENT;
@@ -981,10 +991,12 @@ class PageLayoutController
             ->setSetVariables(array_keys($this->MOD_MENU));
         $this->buttonBar->addButton($shortcutButton);
 
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Cache
         if (empty($this->modTSconfig['properties']['disableAdvanced'])) {
             $clearCacheButton = $this->buttonBar->makeLinkButton()
-                ->setHref(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->pageinfo['uid'], 'clear_cache' => '1']))
+                ->setHref((string)$uriBuilder->buildUriFromRoute($this->moduleName, ['id' => $this->pageinfo['uid'], 'clear_cache' => '1']))
                 ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.clear_cache'))
                 ->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL));
             $this->buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT, 1);
@@ -1027,7 +1039,8 @@ class PageLayoutController
                         ],
                         'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                     ];
-                    $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+
+                    $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                     $editLanguageButton = $this->buttonBar->makeLinkButton()
                         ->setHref($url)
                         ->setTitle($lang->getLL('editPageLanguageOverlayProperties'))
@@ -1042,7 +1055,7 @@ class PageLayoutController
                     ],
                     'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                 ];
-                $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                 $editPageButton = $this->buttonBar->makeLinkButton()
                     ->setHref($url)
                     ->setTitle($lang->getLL('editPageProperties'))
@@ -1202,6 +1215,8 @@ class PageLayoutController
     protected function makeLanguageMenu()
     {
         if (count($this->MOD_MENU['language']) > 1) {
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
             $lang = $this->getLanguageService();
             $languageMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
             $languageMenu->setIdentifier('languageMenu');
@@ -1209,7 +1224,7 @@ class PageLayoutController
                 $menuItem = $languageMenu
                     ->makeMenuItem()
                     ->setTitle($language)
-                    ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&SET[language]=' . $key);
+                    ->setHref((string)$uriBuilder->buildUriFromRoute($this->moduleName) . '&id=' . $this->id . '&SET[language]=' . $key);
                 if ((int)$this->current_sys_language === $key) {
                     $menuItem->setActive(true);
                 }
diff --git a/typo3/sysext/backend/Classes/Controller/Wizard/AddController.php b/typo3/sysext/backend/Classes/Controller/Wizard/AddController.php
index a7f7063d6faf..234e6fc8c2da 100644
--- a/typo3/sysext/backend/Classes/Controller/Wizard/AddController.php
+++ b/typo3/sysext/backend/Classes/Controller/Wizard/AddController.php
@@ -269,7 +269,9 @@ class AddController extends AbstractWizardController
         } else {
             // Redirecting to FormEngine with instructions to create a new record
             // AND when closing to return back with information about that records ID etc.
-            $redirectUrl = BackendUtility::getModuleUrl('record_edit', [
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $redirectUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                 'returnEditConf' => 1,
                 'edit[' . $this->P['params']['table'] . '][' . $this->pid . ']' => 'new',
                 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
diff --git a/typo3/sysext/backend/Classes/Controller/Wizard/EditController.php b/typo3/sysext/backend/Classes/Controller/Wizard/EditController.php
index b9f1e9e7d5f4..6b8884f547b4 100644
--- a/typo3/sysext/backend/Classes/Controller/Wizard/EditController.php
+++ b/typo3/sysext/backend/Classes/Controller/Wizard/EditController.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\Wizard;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\RelationHandler;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
@@ -102,8 +101,11 @@ class EditController extends AbstractWizardController
         $config = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
         $fTable = $config['foreign_table'];
 
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         $urlParameters = [
-            'returnUrl' => BackendUtility::getModuleUrl('wizard_edit', ['doClose' => 1])
+            'returnUrl' => (string)$uriBuilder->buildUriFromRoute('wizard_edit', ['doClose' => 1])
         ];
 
         // Detecting the various allowed field type setups and acting accordingly.
@@ -116,7 +118,7 @@ class EditController extends AbstractWizardController
             // SINGLE value
             $urlParameters['edit[' . $fTable . '][' . $this->P['currentValue'] . ']'] = 'edit';
             // Redirect to FormEngine
-            $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+            $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
             HttpUtility::redirect($url);
         } elseif (is_array($config)
             && $this->P['currentSelectedValues']
@@ -142,7 +144,7 @@ class EditController extends AbstractWizardController
                 $urlParameters['edit[' . $recTableUidParts[0] . '][' . $recTableUidParts[1] . ']'] = 'edit';
             }
             // Redirect to FormEngine
-            $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+            $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
             HttpUtility::redirect($url);
         } else {
             return $this->closeWindow;
diff --git a/typo3/sysext/backend/Classes/Controller/Wizard/ListController.php b/typo3/sysext/backend/Classes/Controller/Wizard/ListController.php
index 63a9a561d050..3d05327f2b43 100644
--- a/typo3/sysext/backend/Classes/Controller/Wizard/ListController.php
+++ b/typo3/sysext/backend/Classes/Controller/Wizard/ListController.php
@@ -106,12 +106,14 @@ class ListController extends AbstractWizardController
         if ((string)$this->id !== '') {
             $redirectUrl = GeneralUtility::sanitizeLocalUrl($this->P['returnUrl']);
         } else {
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
             // Otherwise, show the list:
             $urlParameters = [];
             $urlParameters['id'] = $this->pid;
             $urlParameters['table'] = $this->P['params']['table'];
             $urlParameters['returnUrl'] = GeneralUtility::getIndpEnv('REQUEST_URI');
-            $redirectUrl = BackendUtility::getModuleUrl('web_list', $urlParameters);
+            $redirectUrl = (string)$uriBuilder->buildUriFromRoute('web_list', $urlParameters);
         }
         HttpUtility::redirect($redirectUrl);
     }
diff --git a/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php b/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php
index 26925707ba60..5983d9ac707e 100644
--- a/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php
+++ b/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Domain\Repository\Module;
  */
 
 use TYPO3\CMS\Backend\Module\ModuleLoader;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Imaging\IconRegistry;
@@ -242,7 +241,9 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
 
         // Unset modules that are meant to be hidden from the menu.
         $loadedModules = $this->removeHiddenModules($loadedModules);
-        $dummyScript = BackendUtility::getModuleUrl('dummy');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $dummyScript = (string)$uriBuilder->buildUriFromRoute('dummy');
         foreach ($loadedModules as $moduleName => $moduleData) {
             $moduleLink = '';
             if (!is_array($moduleData['sub'])) {
@@ -278,7 +279,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
                     if (isset($submoduleData['script'])) {
                         $submoduleLink = GeneralUtility::resolveBackPath($submoduleData['script']);
                     } else {
-                        $submoduleLink = BackendUtility::getModuleUrl($submoduleData['name']);
+                        $submoduleLink = (string)$uriBuilder->buildUriFromRoute($submoduleData['name']);
                     }
                     $submoduleKey = $moduleName . '_' . $submoduleName;
                     $submoduleLabels = $moduleLoader->getLabelsForModule($submoduleKey);
diff --git a/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php b/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
index d00ac33f581f..940eb7b1d662 100644
--- a/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
+++ b/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
@@ -519,7 +519,8 @@ class InlineRecordContainer extends AbstractContainer
                     ->execute()
                     ->fetch();
                 if (!empty($recordInDatabase)) {
-                    $url = BackendUtility::getModuleUrl('record_edit', [
+                    $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+                    $url = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                         'edit[sys_file_metadata][' . (int)$recordInDatabase['uid'] . ']' => 'edit',
                         'returnUrl' => $this->data['returnUrl']
                     ]);
diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/AddRecord.php b/typo3/sysext/backend/Classes/Form/FieldControl/AddRecord.php
index 0f197efe8b7d..f2392813f555 100644
--- a/typo3/sysext/backend/Classes/Form/FieldControl/AddRecord.php
+++ b/typo3/sysext/backend/Classes/Form/FieldControl/AddRecord.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Form\FieldControl;
  */
 
 use TYPO3\CMS\Backend\Form\AbstractNode;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -100,13 +99,14 @@ class AddRecord extends AbstractNode
         $onClick = [];
         $onClick[] = 'this.blur();';
         $onClick[] = 'return !TBE_EDITOR.isFormChanged();';
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         return [
             'iconIdentifier' => 'actions-add',
             'title' => $title,
             'linkAttributes' => [
                 'onClick' => implode('', $onClick),
-                'href' => BackendUtility::getModuleUrl('wizard_add', $urlParameters),
+                'href' => (string)$uriBuilder->buildUriFromRoute('wizard_add', $urlParameters),
             ],
         ];
     }
diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/EditPopup.php b/typo3/sysext/backend/Classes/Form/FieldControl/EditPopup.php
index 1c4fe06b8b83..9aa0fd9032b0 100644
--- a/typo3/sysext/backend/Classes/Form/FieldControl/EditPopup.php
+++ b/typo3/sysext/backend/Classes/Form/FieldControl/EditPopup.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Form\FieldControl;
  */
 
 use TYPO3\CMS\Backend\Form\AbstractNode;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -52,8 +51,9 @@ class EditPopup extends AbstractNode
                 'fieldChangeFuncHash' => GeneralUtility::hmac(serialize($parameterArray['fieldChangeFunc'])),
             ],
         ];
-
-        $url = BackendUtility::getModuleUrl('wizard_edit', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $url = (string)$uriBuilder->buildUriFromRoute('wizard_edit', $urlParameters);
         $onClick = [];
         $onClick[] = 'this.blur();';
         $onClick[] = 'if (!TBE_EDITOR.curSelected(' . GeneralUtility::quoteJSvalue($itemName) . ')) {';
diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/LinkPopup.php b/typo3/sysext/backend/Classes/Form/FieldControl/LinkPopup.php
index d327a2744342..588a41b0b103 100644
--- a/typo3/sysext/backend/Classes/Form/FieldControl/LinkPopup.php
+++ b/typo3/sysext/backend/Classes/Form/FieldControl/LinkPopup.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Form\FieldControl;
  */
 
 use TYPO3\CMS\Backend\Form\AbstractNode;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -64,7 +63,9 @@ class LinkPopup extends AbstractNode
                 'fieldChangeFuncHash' => GeneralUtility::hmac(serialize($parameterArray['fieldChangeFunc'])),
             ],
         ];
-        $url = BackendUtility::getModuleUrl('wizard_link', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $url = (string)$uriBuilder->buildUriFromRoute('wizard_link', $urlParameters);
         $onClick = [];
         $onClick[] = 'this.blur();';
         $onClick[] = 'vHWin=window.open(';
diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/ListModule.php b/typo3/sysext/backend/Classes/Form/FieldControl/ListModule.php
index e7f560dc7677..0a19446221bb 100644
--- a/typo3/sysext/backend/Classes/Form/FieldControl/ListModule.php
+++ b/typo3/sysext/backend/Classes/Form/FieldControl/ListModule.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Form\FieldControl;
  */
 
 use TYPO3\CMS\Backend\Form\AbstractNode;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -86,13 +85,14 @@ class ListModule extends AbstractNode
         $onClick = [];
         $onClick[] = 'this.blur();';
         $onClick[] = 'return !TBE_EDITOR.isFormChanged();';
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         return [
             'iconIdentifier' => 'actions-system-list-open',
             'title' => $title,
             'linkAttributes' => [
                 'onClick' => implode('', $onClick),
-                'href' => BackendUtility::getModuleUrl('wizard_list', $urlParameters),
+                'href' => (string)$uriBuilder->buildUriFromRoute('wizard_list', $urlParameters),
             ],
         ];
     }
diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/TableWizard.php b/typo3/sysext/backend/Classes/Form/FieldControl/TableWizard.php
index b3089466446f..0cee69468ca4 100644
--- a/typo3/sysext/backend/Classes/Form/FieldControl/TableWizard.php
+++ b/typo3/sysext/backend/Classes/Form/FieldControl/TableWizard.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Form\FieldControl;
  */
 
 use TYPO3\CMS\Backend\Form\AbstractNode;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 
@@ -70,13 +69,14 @@ class TableWizard extends AbstractNode
         $onClick = [];
         $onClick[] = 'this.blur();';
         $onClick[] = 'return !TBE_EDITOR.isFormChanged();';
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         return [
             'iconIdentifier' => 'content-table',
             'title' => $title,
             'linkAttributes' => [
                 'onClick' => implode('', $onClick),
-                'href' => BackendUtility::getModuleUrl('wizard_table', $urlParameters),
+                'href' => (string)$uriBuilder->buildUriFromRoute('wizard_table', $urlParameters),
             ],
         ];
     }
diff --git a/typo3/sysext/backend/Classes/Form/FormResultCompiler.php b/typo3/sysext/backend/Classes/Form/FormResultCompiler.php
index 104938e1a4f0..41f4d34e4dc1 100644
--- a/typo3/sysext/backend/Classes/Form/FormResultCompiler.php
+++ b/typo3/sysext/backend/Classes/Form/FormResultCompiler.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Backend\Form;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
@@ -195,6 +194,8 @@ class FormResultCompiler
     protected function JSbottom()
     {
         $pageRenderer = $this->getPageRenderer();
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
 
         // @todo: this is messy here - "additional hidden fields" should be handled elsewhere
         $html = implode(LF, $this->hiddenFieldAccum);
@@ -202,7 +203,7 @@ class FormResultCompiler
         // load the main module for FormEngine with all important JS functions
         $this->requireJsModules['TYPO3/CMS/Backend/FormEngine'] = 'function(FormEngine) {
 			FormEngine.initialize(
-				' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('wizard_element_browser')) . ',
+				' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('wizard_element_browser')) . ',
 				' . ($GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? '1' : '0') . '
 			);
 		}';
diff --git a/typo3/sysext/backend/Classes/Module/ModuleLoader.php b/typo3/sysext/backend/Classes/Module/ModuleLoader.php
index aec015687cc5..529fcf4bae57 100644
--- a/typo3/sysext/backend/Classes/Module/ModuleLoader.php
+++ b/typo3/sysext/backend/Classes/Module/ModuleLoader.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Backend\Module;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -169,15 +168,16 @@ class ModuleLoader
         $finalModuleConfiguration['name'] = $name;
         // Language processing. This will add module labels and image reference to the internal ->moduleLabels array of the LANG object.
         $this->addLabelsForModule($name, ($finalModuleConfiguration['labels'] ?? $setupInformation['labels']));
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         if (isset($setupInformation['configuration']['routeTarget'])) {
-            $finalModuleConfiguration['script'] = BackendUtility::getModuleUrl($name);
+            $finalModuleConfiguration['script'] = (string)$uriBuilder->buildUriFromRoute($name);
         } else {
-            $finalModuleConfiguration['script'] = BackendUtility::getModuleUrl('dummy');
+            $finalModuleConfiguration['script'] = (string)$uriBuilder->buildUriFromRoute('dummy');
         }
 
         if (!empty($setupInformation['configuration']['navigationFrameModule'])) {
-            $finalModuleConfiguration['navFrameScript'] = BackendUtility::getModuleUrl(
+            $finalModuleConfiguration['navFrameScript'] = (string)$uriBuilder->buildUriFromRoute(
                 $setupInformation['configuration']['navigationFrameModule'],
                 !empty($setupInformation['configuration']['navigationFrameModuleParameters'])
                     ? $setupInformation['configuration']['navigationFrameModuleParameters']
diff --git a/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php b/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
index 7c035a5fad75..ed266303389f 100644
--- a/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
+++ b/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Backend\Search\LiveSearch;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -262,8 +263,9 @@ class LiveSearch
         }
         // "Edit" link - Only if permissions to edit the page-record of the content of the parent page ($this->id)
         if ($permsEdit) {
-            $returnUrl = BackendUtility::getModuleUrl('web_list', ['id' => $row['pid']]);
-            $editLink = BackendUtility::getModuleUrl('record_edit', [
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+            $returnUrl = (string)$uriBuilder->buildUriFromRoute('web_list', ['id' => $row['pid']]);
+            $editLink = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                 'edit[' . $tableName . '][' . $row['uid'] . ']' => 'edit',
                 'returnUrl' => $returnUrl
             ]);
diff --git a/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php b/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php
index e873c17a5b73..7d344eda0060 100644
--- a/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php
+++ b/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php
@@ -14,6 +14,9 @@ namespace TYPO3\CMS\Backend\Tree\View;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Routing\UriBuilder;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * Local position map class when creating new Content Elements
  */
@@ -48,12 +51,13 @@ class ContentCreationPagePositionMap extends PagePositionMap
      */
     public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0)
     {
-        $location = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_edit', [
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+        $location = (string)$uriBuilder->buildUriFromRoute('record_edit', [
             'edit[tt_content][' . (is_array($row) ? -$row['uid'] : $pid) . ']' => 'new',
             'defVals[tt_content][colPos]' => $vv,
             'defVals[tt_content][sys_language_uid]' => $sys_lang,
             'returnUrl' => $GLOBALS['SOBE']->R_URI
         ]);
-        return 'list_frame.location.href=' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($location) . '+document.editForm.defValues.value; return false;';
+        return 'list_frame.location.href=' . GeneralUtility::quoteJSvalue($location) . '+document.editForm.defValues.value; return false;';
     }
 }
diff --git a/typo3/sysext/backend/Classes/Tree/View/PageMovingPagePositionMap.php b/typo3/sysext/backend/Classes/Tree/View/PageMovingPagePositionMap.php
index 60b77b9c0c88..98b027c325aa 100644
--- a/typo3/sysext/backend/Classes/Tree/View/PageMovingPagePositionMap.php
+++ b/typo3/sysext/backend/Classes/Tree/View/PageMovingPagePositionMap.php
@@ -14,6 +14,9 @@ namespace TYPO3\CMS\Backend\Tree\View;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Routing\UriBuilder;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * Position map class for moving pages,
  * previously resided in typo3/move_el.php
@@ -41,7 +44,11 @@ class PageMovingPagePositionMap extends PagePositionMap
      */
     public function onClickEvent($pid, $newPagePID)
     {
-        return 'window.location.href=' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('tce_db') . '&cmd[pages][' . $GLOBALS['SOBE']->moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&redirect=' . rawurlencode($this->R_URI)) . ';return false;';
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+        return 'window.location.href=' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('tce_db', [
+            'cmd[pages][' . $GLOBALS['SOBE']->moveUid . '][' . $this->moveOrCopy . ']' => $pid,
+            'redirect' => rawurlencode($this->R_URI)
+        ])) . ';return false;';
     }
 
     /**
@@ -53,7 +60,7 @@ class PageMovingPagePositionMap extends PagePositionMap
      */
     public function linkPageTitle($str, $rec)
     {
-        $url = \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(['uid' => (int)$rec['uid'], 'moveUid' => $GLOBALS['SOBE']->moveUid]);
+        $url = GeneralUtility::linkThisScript(['uid' => (int)$rec['uid'], 'moveUid' => $GLOBALS['SOBE']->moveUid]);
         return '<a href="' . htmlspecialchars($url) . '">' . $str . '</a>';
     }
 
diff --git a/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php b/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php
index 106336b5a327..67f672db7011 100644
--- a/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php
+++ b/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Backend\Tree\View;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -273,15 +274,17 @@ class PagePositionMap
         $TSconfig = BackendUtility::getModTSconfig($newPagePID, 'mod.newPageWizard');
         $TSconfig = $TSconfig['properties'];
         if (isset($TSconfig['override']) && !empty($TSconfig['override'])) {
-            $url = BackendUtility::getModuleUrl(
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+            $url = $uriBuilder->buildUriFromRoute(
                 $TSconfig['override'],
                 [
-                'positionPid' => $pid,
-                'newPageId'   => $newPagePID,
-                'cmd'         => 'crPage',
-                'returnUrl'   => GeneralUtility::getIndpEnv('REQUEST_URI')]
+                    'positionPid' => $pid,
+                    'newPageId'   => $newPagePID,
+                    'cmd'         => 'crPage',
+                    'returnUrl'   => GeneralUtility::getIndpEnv('REQUEST_URI')
+                ]
             );
-            return 'list_frame.location.href=' . GeneralUtility::quoteJSvalue($url) . ';';
+            return 'list_frame.location.href=' . GeneralUtility::quoteJSvalue((string)$url) . ';';
         }
         $params = '&edit[pages][' . $pid . ']=new&returnNewPageId=1';
         return BackendUtility::editOnClick($params, '', $this->R_URI);
@@ -560,15 +563,21 @@ class PagePositionMap
      */
     public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0)
     {
-        $table = 'tt_content';
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
         if (is_array($row)) {
-            $location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=-' . $row['uid'];
+            $location = $uriBuilder->buildUriFromRoute('tce_db', [
+                'cmd[tt_content][' . $moveUid . '][' . $this->moveOrCopy . ']' => '-' . $row['uid'],
+                'redirect' => rawurlencode($this->R_URI)
+            ]);
         } else {
-            $location = BackendUtility::getModuleUrl('tce_db') . '&cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&data[' . $table . '][' . $moveUid . '][colPos]=' . $vv;
+            $location = $uriBuilder->buildUriFromRoute('tce_db', [
+                'cmd[tt_content][' . $moveUid . '][' . $this->moveOrCopy . ']' => $pid,
+                'data[tt_content][' . $moveUid . '][colPos]' => $vv,
+                'redirect' => rawurlencode($this->R_URI)
+            ]);
         }
-        $location .= '&redirect=' . rawurlencode($this->R_URI);
         // returns to prev. page
-        return 'list_frame.location.href=' . GeneralUtility::quoteJSvalue($location) . ';return false;';
+        return 'list_frame.location.href=' . GeneralUtility::quoteJSvalue((string)$location) . ';return false;';
     }
 
     /**
diff --git a/typo3/sysext/backend/Classes/Utility/BackendUtility.php b/typo3/sysext/backend/Classes/Utility/BackendUtility.php
index 2df6233879c1..6545e024c03e 100644
--- a/typo3/sysext/backend/Classes/Utility/BackendUtility.php
+++ b/typo3/sysext/backend/Classes/Utility/BackendUtility.php
@@ -2514,7 +2514,8 @@ class BackendUtility
         } else {
             $returnUrl = GeneralUtility::quoteJSvalue(rawurlencode($requestUri ?: GeneralUtility::getIndpEnv('REQUEST_URI')));
         }
-        return 'window.location.href=' . GeneralUtility::quoteJSvalue(self::getModuleUrl('record_edit') . $params . '&returnUrl=') . '+' . $returnUrl . '; return false;';
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+        return 'window.location.href=' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('record_edit') . $params . '&returnUrl=') . '+' . $returnUrl . '; return false;';
     }
 
     /**
@@ -2642,7 +2643,8 @@ class BackendUtility
      */
     public static function getLinkToDataHandlerAction($parameters, $redirectUrl = '')
     {
-        $url = self::getModuleUrl('tce_db') . $parameters . '&redirect=';
+        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+        $url = (string)$uriBuilder->buildUriFromRoute('tce_db') . $parameters . '&redirect=';
         if ((int)$redirectUrl === -1) {
             $url = GeneralUtility::quoteJSvalue($url) . '+T3_THIS_LOCATION';
         } else {
@@ -4324,7 +4326,7 @@ class BackendUtility
                 break;
             case 'backend':
             default:
-                $script = self::getModuleUrl('main');
+                $script = (string)GeneralUtility::makeInstance(UriBuilder::class)->buildUriFromRoute('main');
         }
         return $script;
     }
diff --git a/typo3/sysext/backend/Classes/View/PageLayoutView.php b/typo3/sysext/backend/Classes/View/PageLayoutView.php
index 55b961b53433..e3bc6ab78724 100644
--- a/typo3/sysext/backend/Classes/View/PageLayoutView.php
+++ b/typo3/sysext/backend/Classes/View/PageLayoutView.php
@@ -21,7 +21,6 @@ use Psr\Log\LoggerAwareTrait;
 use TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider;
 use TYPO3\CMS\Backend\Controller\Page\LocalizationController;
 use TYPO3\CMS\Backend\Controller\PageLayoutController;
-use TYPO3\CMS\Backend\Routing\Router;
 use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Tree\View\PageTreeView;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
@@ -773,7 +772,8 @@ class PageLayoutView implements LoggerAwareInterface
                         'columnsOnly' => $field,
                         'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                     ];
-                    $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                    $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                    $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                     $eI = '<a class="btn btn-default" href="' . htmlspecialchars($url)
                         . '" title="' . htmlspecialchars($iTitle) . '">'
                         . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
@@ -934,10 +934,10 @@ class PageLayoutView implements LoggerAwareInterface
                             'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                         ];
                         $tsConfig = BackendUtility::getModTSconfig($id, 'mod');
-                        $moduleName = isset($tsConfig['properties']['newContentElementWizard.']['override'])
-                            ? $tsConfig['properties']['newContentElementWizard.']['override']
-                            : 'new_content_element_wizard';
-                        $url = BackendUtility::getModuleUrl($moduleName, $urlParameters);
+                        $routeName = $tsConfig['properties']['newContentElementWizard.']['override']
+                            ?? 'new_content_element_wizard';
+                        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                        $url = (string)$uriBuilder->buildUriFromRoute($routeName, $urlParameters);
                     } else {
                         $urlParameters = [
                             'edit' => [
@@ -953,7 +953,8 @@ class PageLayoutView implements LoggerAwareInterface
                             ],
                             'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                         ];
-                        $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                        $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                     }
                     $title = htmlspecialchars($this->getLanguageService()->getLL('newContentElement'));
                     $link = '<a href="#" data-url="' . htmlspecialchars($url) . '" '
@@ -1056,10 +1057,10 @@ class PageLayoutView implements LoggerAwareInterface
                                         'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                                     ];
                                     $tsConfig = BackendUtility::getModTSconfig($row['pid'], 'mod');
-                                    $moduleName = isset($tsConfig['properties']['newContentElementWizard.']['override'])
-                                        ? $tsConfig['properties']['newContentElementWizard.']['override']
-                                        : 'new_content_element_wizard';
-                                    $url = BackendUtility::getModuleUrl($moduleName, $urlParameters);
+                                    $routeName = $tsConfig['properties']['newContentElementWizard.']['override']
+                                        ?? 'new_content_element_wizard';
+                                    $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                                    $url = (string)$uriBuilder->buildUriFromRoute($routeName, $urlParameters);
                                 } else {
                                     $urlParameters = [
                                         'edit' => [
@@ -1069,7 +1070,8 @@ class PageLayoutView implements LoggerAwareInterface
                                         ],
                                         'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                                     ];
-                                    $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                                    $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                                    $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                                 }
                                 $title = htmlspecialchars($this->getLanguageService()->getLL('newContentElement'));
                                 $singleElementHTML .= '<a href="#" data-url="' . htmlspecialchars($url) . '" '
@@ -1296,7 +1298,8 @@ class PageLayoutView implements LoggerAwareInterface
                         ],
                         'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                     ];
-                    $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                    $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                    $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                     $editLink = (
                         $this->getBackendUser()->check('tables_modify', 'pages')
                         ? '<a href="' . htmlspecialchars($url) . '" class="btn btn-default btn-sm"'
@@ -1328,7 +1331,8 @@ class PageLayoutView implements LoggerAwareInterface
                             ],
                             'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                         ];
-                        $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                        $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                         $editLink = (
                             $this->getBackendUser()->check('tables_modify', 'pages')
                             ? '<a href="' . htmlspecialchars($url) . '" class="btn btn-default btn-sm"'
@@ -1445,7 +1449,8 @@ class PageLayoutView implements LoggerAwareInterface
                 ],
                 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
             ];
-            $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+            $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
             $title = htmlspecialchars($this->getLanguageService()->getLL('new'));
             $theData['__cmds__'] = '<a href="#" data-url="' . htmlspecialchars($url) . '" class="t3js-toggle-new-content-element-wizard" '
                 . 'title="' . $title . '"'
@@ -1478,7 +1483,8 @@ class PageLayoutView implements LoggerAwareInterface
                             ],
                             'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                         ];
-                        $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                        $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                         $Nrow['__editIconLink__'] = '<a class="btn btn-default" href="' . htmlspecialchars($url)
                             . '" title="' . htmlspecialchars($this->getLanguageService()->getLL('edit')) . '">'
                             . $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render() . '</a>';
@@ -1729,7 +1735,8 @@ class PageLayoutView implements LoggerAwareInterface
                             ],
                             'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                         ];
-                        $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                        $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                         $eI = '<a class="btn btn-default" href="' . htmlspecialchars($url)
                             . '" title="' . htmlspecialchars($this->getLanguageService()->getLL('editThisPage')) . '">'
                             . $this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)->render() . '</a>';
@@ -1901,7 +1908,8 @@ class PageLayoutView implements LoggerAwareInterface
                     ],
                     'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') . '#element-tt_content-' . $row['uid'],
                 ];
-                $url = BackendUtility::getModuleUrl('record_edit', $urlParameters) . '#element-tt_content-' . $row['uid'];
+                $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters) . '#element-tt_content-' . $row['uid'];
 
                 $out .= '<a class="btn btn-default" href="' . htmlspecialchars($url)
                     . '" title="' . htmlspecialchars($this->nextThree > 1
@@ -2374,12 +2382,17 @@ class PageLayoutView implements LoggerAwareInterface
     {
         if ($this->option_newWizard) {
             $tsConfig = BackendUtility::getModTSconfig($id, 'mod');
-            $moduleName = isset($tsConfig['properties']['newContentElementWizard.']['override'])
-                ? $tsConfig['properties']['newContentElementWizard.']['override']
-                : 'new_content_element_wizard';
-            $onClick = 'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl($moduleName) . '&id=' . $id . '&colPos=' . $colPos
-                . '&sys_language_uid=' . $sys_language . '&uid_pid=' . $id
-                . '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))) . ';';
+            $routeName = $tsConfig['properties']['newContentElementWizard.']['override']
+                ?? 'new_content_element_wizard';
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+            $url = $uriBuilder->buildUriFromRoute($routeName, [
+                'id' => $id,
+                'colPos' => $colPos,
+                'sys_language_uid' => $sys_language,
+                'uid_pid' => $id,
+                'returnUrl' => rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))
+            ]);
+            $onClick = 'window.location.href=' . GeneralUtility::quoteJSvalue((string)$url) . ';';
         } else {
             $onClick = BackendUtility::editOnClick('&edit[tt_content][' . $id . ']=new&defVals[tt_content][colPos]='
                 . $colPos . '&defVals[tt_content][sys_language_uid]=' . $sys_language);
@@ -2407,7 +2420,8 @@ class PageLayoutView implements LoggerAwareInterface
                 ],
                 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') . '#element-tt_content-' . $row['uid']
             ];
-            $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+            $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
             // Return link
             return '<a href="' . htmlspecialchars($url) . '" title="' . htmlspecialchars($this->getLanguageService()->getLL('edit')) . '">' . $str . '</a>';
         }
@@ -2536,7 +2550,8 @@ class PageLayoutView implements LoggerAwareInterface
                         'justLocalized' => 'pages:' . $id . ':' . $languageUid,
                         'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                     ];
-                    $redirectUrl = BackendUtility::getModuleUrl('record_edit', $parameters);
+                    $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                    $redirectUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
                     $targetUrl = BackendUtility::getLinkToDataHandlerAction(
                         '&cmd[pages][' . $id . '][localize]=' . $languageUid,
                         $redirectUrl
@@ -3748,12 +3763,8 @@ class PageLayoutView implements LoggerAwareInterface
         $urlParameters = array_merge_recursive($urlParameters, $this->overrideUrlParameters);
 
         if ($routePath = GeneralUtility::_GP('route')) {
-            $router = GeneralUtility::makeInstance(Router::class);
-            $route = $router->match($routePath);
             $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
-            $url = (string)$uriBuilder->buildUriFromRoute($route->getOption('_identifier'), $urlParameters);
-        } elseif ($moduleName = GeneralUtility::_GP('M')) {
-            $url = BackendUtility::getModuleUrl($moduleName, $urlParameters);
+            $url = (string)$uriBuilder->buildUriFromRoutePath($routePath, $urlParameters);
         } else {
             $url = GeneralUtility::getIndpEnv('SCRIPT_NAME') . '?' . ltrim(
                     GeneralUtility::implodeArrayForUrl('', $urlParameters),
@@ -3871,7 +3882,8 @@ class PageLayoutView implements LoggerAwareInterface
             if ($localizedRecordUid !== false) {
                 // Create parameters and finally run the classic page module for creating a new page translation
                 $url = $this->listURL();
-                $editUserAccountUrl = BackendUtility::getModuleUrl(
+                $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
+                $editUserAccountUrl = (string)$uriBuilder->buildUriFromRoute(
                     'record_edit',
                     [
                         'edit[' . $table . '][' . $localizedRecordUid . ']' => 'edit',
@@ -4057,12 +4069,8 @@ class PageLayoutView implements LoggerAwareInterface
     protected function determineScriptUrl()
     {
         if ($routePath = GeneralUtility::_GP('route')) {
-            $router = GeneralUtility::makeInstance(Router::class);
-            $route = $router->match($routePath);
             $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
-            $this->thisScript = (string)$uriBuilder->buildUriFromRoute($route->getOption('_identifier'));
-        } elseif ($moduleName = GeneralUtility::_GP('M')) {
-            $this->thisScript = BackendUtility::getModuleUrl($moduleName);
+            $this->thisScript = (string)$uriBuilder->buildUriFromRoutePath($routePath);
         } else {
             $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');
         }
diff --git a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLinkViewHelper.php b/typo3/sysext/backend/Classes/ViewHelpers/ModuleLinkViewHelper.php
index 9ef56faee000..b95792e30c0d 100644
--- a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLinkViewHelper.php
+++ b/typo3/sysext/backend/Classes/ViewHelpers/ModuleLinkViewHelper.php
@@ -15,7 +15,7 @@ namespace TYPO3\CMS\Backend\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
@@ -47,6 +47,8 @@ class ModuleLinkViewHelper extends AbstractViewHelper
      */
     public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
     {
-        return BackendUtility::getModuleUrl($arguments['route'], $arguments['arguments']);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute($arguments['route'], $arguments['arguments']);
     }
 }
diff --git a/typo3/sysext/belog/Classes/Controller/SystemInformationController.php b/typo3/sysext/belog/Classes/Controller/SystemInformationController.php
index b7f622338340..059614d2944e 100644
--- a/typo3/sysext/belog/Classes/Controller/SystemInformationController.php
+++ b/typo3/sysext/belog/Classes/Controller/SystemInformationController.php
@@ -15,8 +15,8 @@ namespace TYPO3\CMS\Belog\Controller;
  */
 
 use TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem;
+use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Belog\Domain\Model\Constraint;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -65,8 +65,9 @@ class SystemInformationController extends AbstractController
             ->fetchColumn(0);
 
         if ($count > 0) {
+            $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
             $systemInformationToolbarItem->addSystemMessage(
-                sprintf(LocalizationUtility::translate('systemmessage.errorsInPeriod', 'belog'), $count, BackendUtility::getModuleUrl('system_BelogLog', ['tx_belog_system_beloglog' => ['constraint' => ['action' => -1]]])),
+                sprintf(LocalizationUtility::translate('systemmessage.errorsInPeriod', 'belog'), $count, (string)$uriBuilder->buildUriFromRoute('system_BelogLog', ['tx_belog_system_beloglog' => ['constraint' => ['action' => -1]]])),
                 InformationStatus::STATUS_ERROR,
                 $count,
                 'system_BelogLog',
diff --git a/typo3/sysext/beuser/Classes/Controller/BackendUserActionController.php b/typo3/sysext/beuser/Classes/Controller/BackendUserActionController.php
index 61a1a70eb975..5603858c99a3 100644
--- a/typo3/sysext/beuser/Classes/Controller/BackendUserActionController.php
+++ b/typo3/sysext/beuser/Classes/Controller/BackendUserActionController.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Beuser\Controller;
  */
 
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\View\BackendTemplateView;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Imaging\Icon;
@@ -127,12 +126,15 @@ class BackendUserActionController extends ActionController
             $modulePrefix = strtolower('tx_' . $extensionName . '_' . $moduleName);
             $getVars = ['id', 'route', $modulePrefix];
         }
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         $shortcutName = $this->getLanguageService()->sL('LLL:EXT:beuser/Resources/Private/Language/locallang.xml:backendUsers');
         if ($this->request->getControllerName() === 'BackendUser') {
             if ($this->request->getControllerActionName() === 'index') {
-                $returnUrl = rawurlencode(BackendUtility::getModuleUrl('system_BeuserTxBeuser'));
+                $returnUrl = rawurlencode((string)$uriBuilder->buildUriFromRoute('system_BeuserTxBeuser'));
                 $parameters = GeneralUtility::explodeUrl2Array('edit[be_users][0]=new&returnUrl=' . $returnUrl);
-                $addUserLink = BackendUtility::getModuleUrl('record_edit', $parameters);
+                $addUserLink = (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
                 $title = $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral');
                 $icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-add', Icon::SIZE_SMALL);
                 $addUserButton = $buttonBar->makeLinkButton()
@@ -142,7 +144,7 @@ class BackendUserActionController extends ActionController
                 $buttonBar->addButton($addUserButton, ButtonBar::BUTTON_POSITION_LEFT);
             }
             if ($this->request->getControllerActionName() === 'compare') {
-                $addUserLink = BackendUtility::getModuleUrl('system_BeuserTxBeuser');
+                $addUserLink = (string)$uriBuilder->buildUriFromRoute('system_BeuserTxBeuser');
                 $title = $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.goBack');
                 $icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL);
                 $addUserButton = $buttonBar->makeLinkButton()
@@ -157,14 +159,14 @@ class BackendUserActionController extends ActionController
         }
         if ($this->request->getControllerName() === 'BackendUserGroup') {
             $shortcutName = $this->getLanguageService()->sL('LLL:EXT:beuser/Resources/Private/Language/locallang.xml:backendUserGroupsMenu');
-            $returnUrl = rawurlencode(BackendUtility::getModuleUrl('system_BeuserTxBeuser', [
+            $returnUrl = rawurlencode((string)$uriBuilder->buildUriFromRoute('system_BeuserTxBeuser', [
                 'tx_beuser_system_beusertxbeuser' => [
                     'action' => 'index',
                     'controller' => 'BackendUserGroup'
                 ]
             ]));
             $parameters = GeneralUtility::explodeUrl2Array('edit[be_groups][0]=new&returnUrl=' . $returnUrl);
-            $addUserLink = BackendUtility::getModuleUrl('record_edit', $parameters);
+            $addUserLink = (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
             $title = $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral');
             $icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-add', Icon::SIZE_SMALL);
             $addUserGroupButton = $buttonBar->makeLinkButton()
diff --git a/typo3/sysext/beuser/Classes/Controller/BackendUserController.php b/typo3/sysext/beuser/Classes/Controller/BackendUserController.php
index 10eba5b6f5e6..ef08b9cdc588 100644
--- a/typo3/sysext/beuser/Classes/Controller/BackendUserController.php
+++ b/typo3/sysext/beuser/Classes/Controller/BackendUserController.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Beuser\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Session\Backend\SessionBackendInterface;
@@ -157,7 +156,9 @@ class BackendUserController extends BackendUserActionController
         $this->view->assign('onlineBackendUsers', $onlineBackendUsers);
 
         $this->view->assign('demand', $demand);
-        $this->view->assign('returnUrl', rawurlencode(BackendUtility::getModuleUrl('system_BeuserTxBeuser')));
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $this->view->assign('returnUrl', rawurlencode((string)$uriBuilder->buildUriFromRoute('system_BeuserTxBeuser')));
         $this->view->assign('dateFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']);
         $this->view->assign('timeFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']);
         $this->view->assign('backendUsers', $this->backendUserRepository->findDemanded($demand));
@@ -195,7 +196,9 @@ class BackendUserController extends BackendUserActionController
         $compareUserList = $this->moduleData->getCompareUserList();
         $this->view->assign('dateFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']);
         $this->view->assign('timeFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']);
-        $returnUrl = BackendUtility::getModuleUrl(
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $returnUrl = (string)$uriBuilder->buildUriFromRoute(
             'system_BeuserTxBeuser',
             [
                 'tx_beuser_system_beusertxbeuser[action]' => 'compare',
diff --git a/typo3/sysext/beuser/Classes/Controller/BackendUserGroupController.php b/typo3/sysext/beuser/Classes/Controller/BackendUserGroupController.php
index 41533932c494..e6cd687f9260 100644
--- a/typo3/sysext/beuser/Classes/Controller/BackendUserGroupController.php
+++ b/typo3/sysext/beuser/Classes/Controller/BackendUserGroupController.php
@@ -14,7 +14,7 @@ namespace TYPO3\CMS\Beuser\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * Backend module user group administration controller
@@ -56,8 +56,10 @@ class BackendUserGroupController extends BackendUserActionController
      */
     public function indexAction()
     {
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         $this->view->assign('backendUserGroups', $this->backendUserGroupRepository->findAll());
-        $this->view->assign('returnUrl', rawurlencode(BackendUtility::getModuleUrl(
+        $this->view->assign('returnUrl', rawurlencode((string)$uriBuilder->buildUriFromRoute(
             'system_BeuserTxBeuser',
             [
                 'tx_beuser_system_beusertxbeuser' => [
diff --git a/typo3/sysext/beuser/Classes/Hook/BackendControllerHook.php b/typo3/sysext/beuser/Classes/Hook/BackendControllerHook.php
index 1bad4ef7c04d..69b1ccb2c219 100644
--- a/typo3/sysext/beuser/Classes/Hook/BackendControllerHook.php
+++ b/typo3/sysext/beuser/Classes/Hook/BackendControllerHook.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Beuser\Hook;
  */
 
 use TYPO3\CMS\Backend\Controller\BackendController;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -32,7 +31,9 @@ class BackendControllerHook
      */
     public function addJavaScript(array $configuration, BackendController $backendController)
     {
-        $this->getPageRenderer()->addInlineSetting('AccessPermissions', 'moduleUrl', BackendUtility::getModuleUrl('system_BeuserTxPermission'));
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $this->getPageRenderer()->addInlineSetting('AccessPermissions', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('system_BeuserTxPermission'));
     }
 
     /**
diff --git a/typo3/sysext/beuser/Classes/Hook/SwitchBackUserHook.php b/typo3/sysext/beuser/Classes/Hook/SwitchBackUserHook.php
index 65678332c368..fbb82749800c 100644
--- a/typo3/sysext/beuser/Classes/Hook/SwitchBackUserHook.php
+++ b/typo3/sysext/beuser/Classes/Hook/SwitchBackUserHook.php
@@ -38,7 +38,9 @@ class SwitchBackUserHook
             $objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
             $backendUserSessionRepository = $objectManager->get(\TYPO3\CMS\Beuser\Domain\Repository\BackendUserSessionRepository::class);
             $backendUserSessionRepository->switchBackToOriginalUser($authentication);
-            HttpUtility::redirect(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('main'));
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            HttpUtility::redirect((string)$uriBuilder->buildUriFromRoute('main'));
         }
     }
 
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/EditRecordViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/EditRecordViewHelper.php
index 38cc932728f7..63da4e7235c1 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/EditRecordViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/EditRecordViewHelper.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
@@ -45,12 +44,14 @@ class EditRecordViewHelper extends AbstractViewHelper
      * @param \Closure $renderChildrenClosure
      * @param RenderingContextInterface $renderingContext
      *
-     * @see \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl()
+     * @see \TYPO3\CMS\Backend\Routing\UriBuilder::buildUriFromRoute()
      * @return string URL to FormEngine module + parameters
      */
     public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
     {
         $parameters = GeneralUtility::explodeUrl2Array($arguments['parameters']);
-        return BackendUtility::getModuleUrl('record_edit', $parameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
     }
 }
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php
index 53c666f27869..be064b3bfb24 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
@@ -57,6 +56,8 @@ class IssueCommandViewHelper extends AbstractViewHelper
             $parametersArray = GeneralUtility::explodeUrl2Array($arguments['parameters']);
             $urlParameters += $parametersArray;
         }
-        return BackendUtility::getModuleUrl('tce_db', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('tce_db', $urlParameters);
     }
 }
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php
index 3cbab50fad0d..8ed5f51c2cde 100644
--- a/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php
+++ b/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Beuser\Domain\Model\BackendUser;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Imaging\Icon;
@@ -75,7 +74,9 @@ class RemoveUserViewHelper extends AbstractViewHelper
             'cmd[be_users][' . $backendUser->getUid() . '][delete]' => 1,
             'redirect' => GeneralUtility::getIndpEnv('REQUEST_URI')
         ];
-        $url = BackendUtility::getModuleUrl('tce_db', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $url = (string)$uriBuilder->buildUriFromRoute('tce_db', $urlParameters);
 
         return '<a class="btn btn-default t3js-modal-trigger" href="' . htmlspecialchars($url) . '"'
             . ' title="' . htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:delete')) . '"'
diff --git a/typo3/sysext/core/Classes/Database/QueryView.php b/typo3/sysext/core/Classes/Database/QueryView.php
index 54f001d17945..8acc21c2911b 100644
--- a/typo3/sysext/core/Classes/Database/QueryView.php
+++ b/typo3/sysext/core/Classes/Database/QueryView.php
@@ -681,9 +681,12 @@ class QueryView
             }
         }
         $out .= '<td>';
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         if (!$row['deleted']) {
             $out .= '<div class="btn-group" role="group">';
-            $url = BackendUtility::getModuleUrl('record_edit', [
+            $url = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                 'edit' => [
                     $table => [
                         $row['uid'] => 'edit'
@@ -701,7 +704,7 @@ class QueryView
             $out .= '</div>';
         } else {
             $out .= '<div class="btn-group" role="group">';
-            $out .= '<a class="btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db', [
+            $out .= '<a class="btn btn-default" href="' . htmlspecialchars((string)$uriBuilder->buildUriFromRoute('tce_db', [
                         'cmd' => [
                             $table => [
                                 $row['uid'] => [
@@ -720,8 +723,8 @@ class QueryView
                 ],
                 'returnUrl' => GeneralUtility::linkThisScript()
             ];
-            $redirectUrl = BackendUtility::getModuleUrl('record_edit', $formEngineParameters);
-            $out .= '<a class="btn btn-default" href="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db', [
+            $redirectUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', $formEngineParameters);
+            $out .= '<a class="btn btn-default" href="' . htmlspecialchars((string)$uriBuilder->buildUriFromRoute('tce_db', [
                     'cmd' => [
                         $table => [
                             $row['uid'] => [
diff --git a/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php b/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
index e28af2751d04..e7a45c2c105f 100644
--- a/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
+++ b/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
@@ -386,6 +386,8 @@ class ExtendedTemplateService extends TemplateService
         }
         $keyArr_num = [];
         $keyArr_alpha = [];
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($arr as $key => $value) {
             // Don't do anything with comments / linenumber registrations...
             if (substr($key, -2) !== '..') {
@@ -420,7 +422,7 @@ class ExtendedTemplateService extends TemplateService
                     if (GeneralUtility::_GP('breakPointLN')) {
                         $urlParameters['breakPointLN'] = GeneralUtility::_GP('breakPointLN');
                     }
-                    $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters) . '#' . $goto;
+                    $aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters) . '#' . $goto;
                     $HTML .= '<a class="list-tree-control' . ($PM === 'minus' ? ' list-tree-control-open' : ' list-tree-control-closed') . '" name="' . $goto . '" href="' . htmlspecialchars($aHref) . '"><i class="fa"></i></a>';
                 }
                 $label = $key;
@@ -436,7 +438,7 @@ class ExtendedTemplateService extends TemplateService
                         if (GeneralUtility::_GP('breakPointLN')) {
                             $urlParameters['breakPointLN'] = GeneralUtility::_GP('breakPointLN');
                         }
-                        $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
+                        $aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
                         if ($this->bType !== 'const') {
                             $ln = is_array($arr[$key . '.ln..']) ? 'Defined in: ' . $this->lineNumberToScript($arr[$key . '.ln..']) : 'N/A';
                         } else {
@@ -637,6 +639,8 @@ class ExtendedTemplateService extends TemplateService
         }
         $a = 0;
         $c = count($keyArr);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         /** @var IconFactory $iconFactory */
         $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
         foreach ($keyArr as $key => $value) {
@@ -657,7 +661,7 @@ class ExtendedTemplateService extends TemplateService
                     'id' => $GLOBALS['SOBE']->id,
                     'template' => $row['templateID']
                 ];
-                $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
+                $aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
                 $A_B = '<a href="' . htmlspecialchars($aHref) . '">';
                 $A_E = '</a>';
                 if (GeneralUtility::_GP('template') == $row['templateID']) {
diff --git a/typo3/sysext/documentation/Classes/Controller/HelpController.php b/typo3/sysext/documentation/Classes/Controller/HelpController.php
index 09653d3200d9..3668f5497aee 100644
--- a/typo3/sysext/documentation/Classes/Controller/HelpController.php
+++ b/typo3/sysext/documentation/Classes/Controller/HelpController.php
@@ -158,11 +158,14 @@ class HelpController extends ActionController
                 ->setGetVariables($getVars);
             $buttonBar->addButton($shortcutButton);
         }
+
         if (isset($getVars['action']) && $getVars['action'] !== 'index') {
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
             $backButton = $buttonBar->makeLinkButton()
                 ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:back'))
                 ->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-view-go-up', Icon::SIZE_SMALL))
-                ->setHref(BackendUtility::getModuleUrl($moduleName));
+                ->setHref((string)$uriBuilder->buildUriFromRoute($moduleName));
             $buttonBar->addButton($backButton);
         }
     }
diff --git a/typo3/sysext/documentation/Classes/Service/JavaScriptService.php b/typo3/sysext/documentation/Classes/Service/JavaScriptService.php
index ad916ea1ff07..24aee31eac30 100644
--- a/typo3/sysext/documentation/Classes/Service/JavaScriptService.php
+++ b/typo3/sysext/documentation/Classes/Service/JavaScriptService.php
@@ -13,7 +13,6 @@ namespace TYPO3\CMS\Documentation\Service;
  *
  * The TYPO3 project - inspiring people to share!
  */
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -36,9 +35,11 @@ class JavaScriptService
         }
         $beUser = $this->getBeUser();
         if ($beUser && !empty($beUser->user)) {
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
             $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
             $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextHelp');
-            $pageRenderer->addInlineSetting('ContextHelp', 'moduleUrl', BackendUtility::getModuleUrl('help_DocumentationCshmanual', [
+            $pageRenderer->addInlineSetting('ContextHelp', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('help_DocumentationCshmanual', [
                 'tx_documentation_help_documentationcshmanual' => [
                     'controller' => 'Help',
                     'action' => 'detail'
diff --git a/typo3/sysext/feedit/Classes/FrontendEditPanel.php b/typo3/sysext/feedit/Classes/FrontendEditPanel.php
index e20689daab70..011873e621b9 100644
--- a/typo3/sysext/feedit/Classes/FrontendEditPanel.php
+++ b/typo3/sysext/feedit/Classes/FrontendEditPanel.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Feedit;
  * The TYPO3 project - inspiring people to share!
  */
 use TYPO3\CMS\Backend\FrontendBackendUserAuthentication;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
@@ -217,7 +216,8 @@ class FrontendEditPanel
             . '</span>';
         $noView = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0;
 
-        $url = BackendUtility::getModuleUrl(
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $url = (string)$uriBuilder->buildUriFromRoute(
             'record_edit',
             [
                 'edit[' . $table . '][' . $editUid . ']' => 'edit',
@@ -258,18 +258,20 @@ class FrontendEditPanel
     protected function editPanelLinkWrap($string, $formName, $cmd, $currentRecord = '', $confirm = '', $nPid = '')
     {
         $noView = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0;
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         if ($cmd === 'edit') {
             $rParts = explode(':', $currentRecord);
-            $out = $this->editPanelLinkWrap_doWrap($string, BackendUtility::getModuleUrl('record_edit', ['edit[' . $rParts[0] . '][' . $rParts[1] . ']' => 'edit', 'noView' => $noView, 'feEdit' => 1]), $currentRecord);
+            $out = $this->editPanelLinkWrap_doWrap($string, (string)$uriBuilder->buildUriFromRoute('record_edit', ['edit[' . $rParts[0] . '][' . $rParts[1] . ']' => 'edit', 'noView' => $noView, 'feEdit' => 1]), $currentRecord);
         } elseif ($cmd === 'new') {
             $rParts = explode(':', $currentRecord);
             if ($rParts[0] === 'pages') {
-                $out = $this->editPanelLinkWrap_doWrap($string, BackendUtility::getModuleUrl('db_new', ['id' => $rParts[1], 'pagesOnly' => 1]), $currentRecord);
+                $out = $this->editPanelLinkWrap_doWrap($string, (string)$uriBuilder->buildUriFromRoute('db_new', ['id' => $rParts[1], 'pagesOnly' => 1]), $currentRecord);
             } else {
                 if (!(int)$nPid) {
                     $nPid = MathUtility::canBeInterpretedAsInteger($rParts[1]) ? -$rParts[1] : $this->frontendController->id;
                 }
-                $out = $this->editPanelLinkWrap_doWrap($string, BackendUtility::getModuleUrl('record_edit', ['edit[' . $rParts[0] . '][' . $nPid . ']' => 'new', 'noView' => $noView]), $currentRecord);
+                $out = $this->editPanelLinkWrap_doWrap($string, (string)$uriBuilder->buildUriFromRoute('record_edit', ['edit[' . $rParts[0] . '][' . $nPid . ']' => 'new', 'noView' => $noView]), $currentRecord);
             }
         } else {
             if ($confirm && $this->backendUser->jsConfirmation(JsConfirmation::FE_EDIT)) {
diff --git a/typo3/sysext/filelist/Classes/Controller/FileListController.php b/typo3/sysext/filelist/Classes/Controller/FileListController.php
index 6fd788355261..7913c7f12176 100644
--- a/typo3/sysext/filelist/Classes/Controller/FileListController.php
+++ b/typo3/sysext/filelist/Classes/Controller/FileListController.php
@@ -528,7 +528,9 @@ class FileListController extends ActionController
 
         $this->view->assign('searchWord', $searchWord);
         $this->view->assign('files', $fileFacades);
-        $this->view->assign('deleteUrl', BackendUtility::getModuleUrl('tce_file'));
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $this->view->assign('deleteUrl', (string)$uriBuilder->buildUriFromRoute('tce_file'));
         $this->view->assign('settings', [
             'jsConfirmationDelete' => $this->getBackendUser()->jsConfirmation(JsConfirmation::DELETE)
         ]);
@@ -594,6 +596,9 @@ class FileListController extends ActionController
 
         $lang = $this->getLanguageService();
 
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         // Refresh page
         $refreshLink = GeneralUtility::linkThisScript(
             [
@@ -617,7 +622,7 @@ class FileListController extends ActionController
                 $levelUpClick = 'top.document.getElementsByName("navigation")[0].contentWindow.Tree.highlightActiveItem("file","folder'
                     . GeneralUtility::md5int($parentFolder->getCombinedIdentifier()) . '_"+top.fsMod.currentBank)';
                 $levelUpButton = $buttonBar->makeLinkButton()
-                    ->setHref(BackendUtility::getModuleUrl('file_FilelistList', ['id' => $parentFolder->getCombinedIdentifier()]))
+                    ->setHref((string)$uriBuilder->buildUriFromRoute('file_FilelistList', ['id' => $parentFolder->getCombinedIdentifier()]))
                     ->setOnClick($levelUpClick)
                     ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.upOneLevel'))
                     ->setIcon($iconFactory->getIcon('actions-view-go-up', Icon::SIZE_SMALL));
@@ -639,7 +644,7 @@ class FileListController extends ActionController
         ) && $this->folderObject->checkActionPermission('write')
         ) {
             $uploadButton = $buttonBar->makeLinkButton()
-                ->setHref(BackendUtility::getModuleUrl(
+                ->setHref((string)$uriBuilder->buildUriFromRoute(
                     'file_upload',
                     [
                         'target' => $this->folderObject->getCombinedIdentifier(),
@@ -660,7 +665,7 @@ class FileListController extends ActionController
             ) || $this->folderObject->checkActionPermission('add'))
         ) {
             $newButton = $buttonBar->makeLinkButton()
-                ->setHref(BackendUtility::getModuleUrl(
+                ->setHref((string)$uriBuilder->buildUriFromRoute(
                     'file_newfolder',
                     [
                         'target' => $this->folderObject->getCombinedIdentifier(),
diff --git a/typo3/sysext/filelist/Classes/FileList.php b/typo3/sysext/filelist/Classes/FileList.php
index bda21a1afd81..2ba04badbe6c 100644
--- a/typo3/sysext/filelist/Classes/FileList.php
+++ b/typo3/sysext/filelist/Classes/FileList.php
@@ -942,7 +942,9 @@ class FileList
      */
     public function linkWrapDir($title, Folder $folderObject)
     {
-        $href = BackendUtility::getModuleUrl('file_FilelistList', ['id' => $folderObject->getCombinedIdentifier()]);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $href = (string)$uriBuilder->buildUriFromRoute('file_FilelistList', ['id' => $folderObject->getCombinedIdentifier()]);
         $onclick = ' onclick="' . htmlspecialchars(('top.document.getElementsByName("navigation")[0].contentWindow.Tree.highlightActiveItem("file","folder' . GeneralUtility::md5int($folderObject->getCombinedIdentifier()) . '_"+top.fsMod.currentBank)')) . '"';
         // Sometimes $code contains plain HTML tags. In such a case the string should not be modified!
         if ((string)$title === strip_tags($title)) {
@@ -971,7 +973,9 @@ class FileList
                     ],
                     'returnUrl' => $this->listURL()
                 ];
-                $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+                $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                 $title = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.editMetadata'));
                 $code = '<a class="responsive-title" href="' . htmlspecialchars($url) . '" title="' . $title . '">' . $code . '</a>';
             }
@@ -1008,6 +1012,8 @@ class FileList
      */
     public function formatFileList(array $files)
     {
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         $out = '';
         // first two keys are "0" (default) and "-1" (multiple), after that comes the "other languages"
         $allSystemLanguages = GeneralUtility::makeInstance(TranslationConfigurationProvider::class)->getSystemLanguages();
@@ -1071,7 +1077,7 @@ class FileList
                                         'returnUrl' => $this->listURL()
                                     ];
                                     $flagButtonIcon = $this->iconFactory->getIcon($flagIcon, Icon::SIZE_SMALL, 'overlay-edit')->render();
-                                    $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                                    $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                                     $languageCode .= '<a href="' . htmlspecialchars($url) . '" class="btn btn-default" title="' . $title . '">'
                                         . $flagButtonIcon . '</a>';
                                 } else {
@@ -1079,7 +1085,7 @@ class FileList
                                         'justLocalized' => 'sys_file_metadata:' . $metaDataRecord['uid'] . ':' . $languageId,
                                         'returnUrl' => $this->listURL()
                                     ];
-                                    $returnUrl = BackendUtility::getModuleUrl('record_edit', $parameters);
+                                    $returnUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
                                     $href = BackendUtility::getLinkToDataHandlerAction(
                                         '&cmd[sys_file_metadata][' . $metaDataRecord['uid'] . '][localize]=' . $languageId,
                                         $returnUrl
@@ -1213,7 +1219,9 @@ class FileList
             $params['SET']['reverse'] = 0;
             $sortArrow = '';
         }
-        $href = BackendUtility::getModuleUrl('file_FilelistList', $params);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $href = (string)$uriBuilder->buildUriFromRoute('file_FilelistList', $params);
         return '<a href="' . htmlspecialchars($href) . '">' . $code . ' ' . $sortArrow . '</a>';
     }
 
@@ -1300,10 +1308,12 @@ class FileList
         $fullIdentifier = $fileOrFolderObject->getCombinedIdentifier();
         $md5 = GeneralUtility::shortMD5($fullIdentifier);
         $isSel = $this->clipObj->isSelected('_FILE', $md5);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
 
         // Edit file content (if editable)
         if ($fileOrFolderObject instanceof File && $fileOrFolderObject->checkActionPermission('write') && GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'], $fileOrFolderObject->getExtension())) {
-            $url = BackendUtility::getModuleUrl('file_edit', ['target' => $fullIdentifier]);
+            $url = (string)$uriBuilder->buildUriFromRoute('file_edit', ['target' => $fullIdentifier]);
             $editOnClick = 'top.list_frame.location.href=' . GeneralUtility::quoteJSvalue($url) . '+\'&returnUrl=\'+top.rawurlencode(top.list_frame.document.location.pathname+top.list_frame.document.location.search);return false;';
             $cells['edit'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($editOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.editcontent') . '">'
                 . $this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)->render()
@@ -1323,7 +1333,7 @@ class FileList
                 ],
                 'returnUrl' => $this->listURL()
             ];
-            $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+            $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
             $title = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.editMetadata'));
             $cells['metadata'] = '<a class="btn btn-default" href="' . htmlspecialchars($url) . '" title="' . $title . '">' . $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render() . '</a>';
         }
@@ -1343,14 +1353,14 @@ class FileList
 
         // replace file
         if ($fileOrFolderObject instanceof File && $fileOrFolderObject->checkActionPermission('replace')) {
-            $url = BackendUtility::getModuleUrl('file_replace', ['target' => $fullIdentifier, 'uid' => $fileOrFolderObject->getUid()]);
+            $url = (string)$uriBuilder->buildUriFromRoute('file_replace', ['target' => $fullIdentifier, 'uid' => $fileOrFolderObject->getUid()]);
             $replaceOnClick = 'top.list_frame.location.href = ' . GeneralUtility::quoteJSvalue($url) . '+\'&returnUrl=\'+top.rawurlencode(top.list_frame.document.location.pathname+top.list_frame.document.location.search);return false;';
             $cells['replace'] = '<a href="#" class="btn btn-default" onclick="' . $replaceOnClick . '"  title="' . $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.replace') . '">' . $this->iconFactory->getIcon('actions-edit-replace', Icon::SIZE_SMALL)->render() . '</a>';
         }
 
         // rename the file
         if ($fileOrFolderObject->checkActionPermission('rename')) {
-            $url = BackendUtility::getModuleUrl('file_rename', ['target' => $fullIdentifier]);
+            $url = (string)$uriBuilder->buildUriFromRoute('file_rename', ['target' => $fullIdentifier]);
             $renameOnClick = 'top.list_frame.location.href = ' . GeneralUtility::quoteJSvalue($url) . '+\'&returnUrl=\'+top.rawurlencode(top.list_frame.document.location.pathname+top.list_frame.document.location.search);return false;';
             $cells['rename'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($renameOnClick) . '"  title="' . $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.rename') . '">' . $this->iconFactory->getIcon('actions-edit-rename', Icon::SIZE_SMALL)->render() . '</a>';
         } else {
@@ -1360,7 +1370,7 @@ class FileList
         // upload files
         if ($fileOrFolderObject->getStorage()->checkUserActionPermission('add', 'File') && $fileOrFolderObject->checkActionPermission('write')) {
             if ($fileOrFolderObject instanceof Folder) {
-                $url = BackendUtility::getModuleUrl('file_upload', ['target' => $fullIdentifier]);
+                $url = (string)$uriBuilder->buildUriFromRoute('file_upload', ['target' => $fullIdentifier]);
                 $uploadOnClick = 'top.list_frame.location.href = ' . GeneralUtility::quoteJSvalue($url) . '+\'&returnUrl=\'+top.rawurlencode(top.list_frame.document.location.pathname+top.list_frame.document.location.search);return false;';
                 $cells['upload'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($uploadOnClick) . '"  title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.upload')) . '">' . $this->iconFactory->getIcon('actions-edit-upload', Icon::SIZE_SMALL)->render() . '</a>';
             }
@@ -1419,7 +1429,7 @@ class FileList
                 $confirmationCheck = '0';
             }
 
-            $deleteUrl = BackendUtility::getModuleUrl('tce_file');
+            $deleteUrl = (string)$uriBuilder->buildUriFromRoute('tce_file');
             $confirmationMessage = sprintf($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:mess.delete'), $fileOrFolderObject->getName()) . $referenceCountText;
             $title = $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.delete');
             $cells['delete'] = '<a href="#" class="btn btn-default t3js-filelist-delete" data-content="' . htmlspecialchars($confirmationMessage)
diff --git a/typo3/sysext/filelist/Classes/Hook/BackendControllerHook.php b/typo3/sysext/filelist/Classes/Hook/BackendControllerHook.php
index 5c3edbbcde78..0faa922d2445 100644
--- a/typo3/sysext/filelist/Classes/Hook/BackendControllerHook.php
+++ b/typo3/sysext/filelist/Classes/Hook/BackendControllerHook.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Filelist\Hook;
  */
 
 use TYPO3\CMS\Backend\Controller\BackendController;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -33,10 +32,12 @@ class BackendControllerHook
     public function addJavaScript(array $configuration, BackendController $backendController)
     {
         $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
-        $pageRenderer->addInlineSetting('FileRename', 'moduleUrl', BackendUtility::getModuleUrl('file_rename'));
-        $pageRenderer->addInlineSetting('FileEdit', 'moduleUrl', BackendUtility::getModuleUrl('file_edit'));
-        $pageRenderer->addInlineSetting('FileUpload', 'moduleUrl', BackendUtility::getModuleUrl('file_upload'));
-        $pageRenderer->addInlineSetting('FileCreate', 'moduleUrl', BackendUtility::getModuleUrl('file_newfolder'));
-        $pageRenderer->addInlineSetting('FileCommit', 'moduleUrl', BackendUtility::getModuleUrl('tce_file'));
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $pageRenderer->addInlineSetting('FileRename', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('file_rename'));
+        $pageRenderer->addInlineSetting('FileEdit', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('file_edit'));
+        $pageRenderer->addInlineSetting('FileUpload', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('file_upload'));
+        $pageRenderer->addInlineSetting('FileCreate', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('file_newfolder'));
+        $pageRenderer->addInlineSetting('FileCommit', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('tce_file'));
     }
 }
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php
index 5ac982067857..fb38011dce65 100644
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Filelist\ViewHelpers\Uri;
  */
 
 use Closure;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
@@ -65,7 +64,8 @@ class DeleteFileViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractView
             ],
             'redirect' => $arguments['returnUrl']
         ];
-
-        return BackendUtility::getModuleUrl('tce_file', $params);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('tce_file', $params);
     }
 }
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditFileContentViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditFileContentViewHelper.php
index 251ac28ff2b8..8a957cbc8b1a 100644
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditFileContentViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditFileContentViewHelper.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Filelist\ViewHelpers\Uri;
  */
 
 use Closure;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
@@ -60,7 +59,8 @@ class EditFileContentViewHelper extends AbstractViewHelper
             'target' => $file->getCombinedIdentifier(),
             'returnUrl' => $arguments['returnUrl']
         ];
-
-        return BackendUtility::getModuleUrl('file_edit', $params);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('file_edit', $params);
     }
 }
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditSysFileMetadataRecordViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditSysFileMetadataRecordViewHelper.php
index 55208b058cf8..85ac73119e7b 100644
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditSysFileMetadataRecordViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/EditSysFileMetadataRecordViewHelper.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Filelist\ViewHelpers\Uri;
  */
 
 use Closure;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
@@ -57,7 +56,8 @@ class EditSysFileMetadataRecordViewHelper extends AbstractViewHelper
             'edit' => ['sys_file_metadata' => [$arguments['uid'] => 'edit']],
             'returnUrl' => $arguments['returnUrl']
         ];
-
-        return BackendUtility::getModuleUrl('record_edit', $params);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('record_edit', $params);
     }
 }
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/RenameFileViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/RenameFileViewHelper.php
index a071fc5f4395..3e2a8b383b7a 100644
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/RenameFileViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/RenameFileViewHelper.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Filelist\ViewHelpers\Uri;
  */
 
 use Closure;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
@@ -60,7 +59,8 @@ class RenameFileViewHelper extends AbstractViewHelper
             'target' => $file->getCombinedIdentifier(),
             'returnUrl' => $arguments['returnUrl']
         ];
-
-        return BackendUtility::getModuleUrl('file_rename', $params);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('file_rename', $params);
     }
 }
diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/ReplaceFileViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/ReplaceFileViewHelper.php
index b1d34ae5c88c..b9b66b492d60 100644
--- a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/ReplaceFileViewHelper.php
+++ b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/ReplaceFileViewHelper.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Filelist\ViewHelpers\Uri;
  */
 
 use Closure;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
@@ -61,7 +60,8 @@ class ReplaceFileViewHelper extends AbstractViewHelper
             'uid' => $file->getUid(),
             'returnUrl' => $arguments['returnUrl']
         ];
-
-        return BackendUtility::getModuleUrl('file_replace', $params);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('file_replace', $params);
     }
 }
diff --git a/typo3/sysext/form/Classes/Controller/FormEditorController.php b/typo3/sysext/form/Classes/Controller/FormEditorController.php
index f9c2f60654ed..b0eae72e6030 100644
--- a/typo3/sysext/form/Classes/Controller/FormEditorController.php
+++ b/typo3/sysext/form/Classes/Controller/FormEditorController.php
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Form\Controller;
  */
 
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\View\BackendTemplateView;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Imaging\Icon;
@@ -109,10 +108,11 @@ class FormEditorController extends AbstractBackendController
         if (!empty($popupWindowSize)) {
             list($popupWindowWidth, $popupWindowHeight) = GeneralUtility::intExplode('x', $popupWindowSize);
         }
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         $addInlineSettings = [
             'FormEditor' => [
-                'typo3WinBrowserUrl' => BackendUtility::getModuleUrl('wizard_element_browser'),
+                'typo3WinBrowserUrl' => (string)$uriBuilder->buildUriFromRoute('wizard_element_browser'),
             ],
             'Popup' => [
                 'PopupWindow' => [
@@ -293,10 +293,12 @@ class FormEditorController extends AbstractBackendController
                 ->setValue('new-page')
                 ->setClasses('t3-form-element-new-page-button hidden')
                 ->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-page-new', Icon::SIZE_SMALL));
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
 
             $closeButton = $buttonBar->makeLinkButton()
                 ->setDataAttributes(['identifier' => 'closeButton'])
-                ->setHref(BackendUtility::getModuleUrl('web_FormFormbuilder'))
+                ->setHref((string)$uriBuilder->buildUriFromRoute('web_FormFormbuilder'))
                 ->setClasses('t3-form-element-close-form-button hidden')
                 ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.closeDoc'))
                 ->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-close', Icon::SIZE_SMALL));
diff --git a/typo3/sysext/form/Classes/Controller/FormManagerController.php b/typo3/sysext/form/Classes/Controller/FormManagerController.php
index 0eb9ef328fc2..609cb34d3de4 100644
--- a/typo3/sysext/form/Classes/Controller/FormManagerController.php
+++ b/typo3/sysext/form/Classes/Controller/FormManagerController.php
@@ -485,7 +485,9 @@ class FormManagerController extends AbstractBackendController
      */
     protected function getModuleUrl(string $moduleName, array $urlParameters = []): string
     {
-        return BackendUtility::getModuleUrl($moduleName, $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute($moduleName, $urlParameters);
     }
 
     /**
diff --git a/typo3/sysext/frontend/Classes/View/AdminPanelView.php b/typo3/sysext/frontend/Classes/View/AdminPanelView.php
index ea7966f8d1aa..412ceafae612 100644
--- a/typo3/sysext/frontend/Classes/View/AdminPanelView.php
+++ b/typo3/sysext/frontend/Classes/View/AdminPanelView.php
@@ -870,7 +870,9 @@ class AdminPanelView
         $moduleName = isset($tsConfig['properties']['newContentElementWizard.']['override'])
             ? $tsConfig['properties']['newContentElementWizard.']['override']
             : 'new_content_element';
-        $newContentWizScriptPath = BackendUtility::getModuleUrl($moduleName);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $newContentWizScriptPath = (string)$uriBuilder->buildUriFromRoute($moduleName);
         $perms = $this->getBackendUser()->calcPerms($tsfe->page);
         $langAllowed = $this->getBackendUser()->checkLanguageAccess($tsfe->sys_language_uid);
         $id = $tsfe->id;
@@ -881,7 +883,7 @@ class AdminPanelView
         $output[] = '  <div class="typo3-adminPanel-btn-group" role="group">';
 
         // History
-        $link = BackendUtility::getModuleUrl(
+        $link = (string)$uriBuilder->buildUriFromRoute(
             'record_history',
             [
                 'element' => 'pages:' . $id,
@@ -909,7 +911,7 @@ class AdminPanelView
 
         // Move Page
         if ($perms & Permission::PAGE_EDIT) {
-            $link = BackendUtility::getModuleUrl(
+            $link = (string)$uriBuilder->buildUriFromRoute(
                 'move_element',
                 [
                     'table' => 'pages',
@@ -926,7 +928,7 @@ class AdminPanelView
 
         // New Page
         if ($perms & Permission::PAGE_NEW) {
-            $link = BackendUtility::getModuleUrl(
+            $link = (string)$uriBuilder->buildUriFromRoute(
                 'db_new',
                 [
                     'id' => $id,
@@ -943,7 +945,7 @@ class AdminPanelView
 
         // Edit Page
         if ($perms & Permission::PAGE_EDIT) {
-            $link = BackendUtility::getModuleUrl(
+            $link = (string)$uriBuilder->buildUriFromRoute(
                 'record_edit',
                 [
                     'edit[pages][' . $id . ']' => 'edit',
@@ -981,7 +983,7 @@ class AdminPanelView
                 ->fetch();
             $tsfe->sys_page->versionOL('pages', $row);
             if (is_array($row)) {
-                $link = BackendUtility::getModuleUrl(
+                $link = (string)$uriBuilder->buildUriFromRoute(
                     'record_edit',
                     [
                         'edit[pages][' . $row['uid'] . ']' => 'edit',
@@ -999,7 +1001,7 @@ class AdminPanelView
 
         // Open list view
         if ($this->getBackendUser()->check('modules', 'web_list')) {
-            $link = BackendUtility::getModuleUrl(
+            $link = (string)$uriBuilder->buildUriFromRoute(
                 'web_list',
                 [
                     'id' => $id,
diff --git a/typo3/sysext/impexp/Classes/Controller/ImportExportController.php b/typo3/sysext/impexp/Classes/Controller/ImportExportController.php
index e32e05c4698c..a42c6007d625 100644
--- a/typo3/sysext/impexp/Classes/Controller/ImportExportController.php
+++ b/typo3/sysext/impexp/Classes/Controller/ImportExportController.php
@@ -215,7 +215,9 @@ class ImportExportController extends BaseScriptClass
             // flag doesn't exist initially; state is on by default
             $inData['excludeDisabled'] = 1;
         }
-        $this->standaloneView->assign('moduleUrl', BackendUtility::getModuleUrl('xMOD_tximpexp'));
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $this->standaloneView->assign('moduleUrl', (string)$uriBuilder->buildUriFromRoute('xMOD_tximpexp'));
         $this->standaloneView->assign('id', $this->id);
         $this->standaloneView->assign('inData', $inData);
 
diff --git a/typo3/sysext/impexp/Classes/Hook/BackendControllerHook.php b/typo3/sysext/impexp/Classes/Hook/BackendControllerHook.php
index 376f253c3cc3..046593d8ee0c 100644
--- a/typo3/sysext/impexp/Classes/Hook/BackendControllerHook.php
+++ b/typo3/sysext/impexp/Classes/Hook/BackendControllerHook.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Impexp\Hook;
  */
 
 use TYPO3\CMS\Backend\Controller\BackendController;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -32,7 +31,9 @@ class BackendControllerHook
      */
     public function addJavaScript(array $configuration, BackendController $backendController)
     {
-        $this->getPageRenderer()->addInlineSetting('ImportExport', 'moduleUrl', BackendUtility::getModuleUrl('xMOD_tximpexp'));
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $this->getPageRenderer()->addInlineSetting('ImportExport', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('xMOD_tximpexp'));
     }
 
     /**
diff --git a/typo3/sysext/impexp/Classes/Task/ImportExportTask.php b/typo3/sysext/impexp/Classes/Task/ImportExportTask.php
index ee716ffaa6a6..e524a7317fa0 100644
--- a/typo3/sysext/impexp/Classes/Task/ImportExportTask.php
+++ b/typo3/sysext/impexp/Classes/Task/ImportExportTask.php
@@ -49,7 +49,9 @@ class ImportExportTask implements TaskInterface
      */
     public function __construct(TaskModuleController $taskObject)
     {
-        $this->moduleUrl = BackendUtility::getModuleUrl('user_task');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $this->moduleUrl = (string)$uriBuilder->buildUriFromRoute('user_task');
         $this->taskObject = $taskObject;
         $this->getLanguageService()->includeLLFile('EXT:impexp/Resources/Private/Language/locallang_csh.xlf');
     }
@@ -84,9 +86,11 @@ class ImportExportTask implements TaskInterface
     {
         $content = '';
         $id = (int)GeneralUtility::_GP('display');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // If a preset is found, it is rendered using an iframe
         if ($id > 0) {
-            $url = BackendUtility::getModuleUrl(
+            $url = (string)$uriBuilder->buildUriFromRoute(
                 'xMOD_tximpexp',
                 [
                     'tx_impexp[action]' => 'export',
@@ -154,7 +158,7 @@ class ImportExportTask implements TaskInterface
                         'icon' => $icon,
                         'title' => $title,
                         'descriptionHtml' => implode('<br />', $description),
-                        'link' => BackendUtility::getModuleUrl('user_task') . '&SET[function]=impexp.TYPO3\\CMS\\Impexp\\Task\\ImportExportTask&display=' . $presetCfg['uid']
+                        'link' => (string)$uriBuilder->buildUriFromRoute('user_task') . '&SET[function]=impexp.TYPO3\\CMS\\Impexp\\Task\\ImportExportTask&display=' . $presetCfg['uid']
                     ];
                 }
                 // Render preset list
diff --git a/typo3/sysext/info/Classes/Controller/InfoModuleController.php b/typo3/sysext/info/Classes/Controller/InfoModuleController.php
index e89111a31504..e70ca2ba3acf 100644
--- a/typo3/sysext/info/Classes/Controller/InfoModuleController.php
+++ b/typo3/sysext/info/Classes/Controller/InfoModuleController.php
@@ -113,7 +113,9 @@ class InfoModuleController extends BaseScriptClass
             $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
 
             $this->view = $this->getFluidTemplateObject();
-            $this->view->assign('moduleName', BackendUtility::getModuleUrl($this->moduleName));
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $this->view->assign('moduleName', (string)$uriBuilder->buildUriFromRoute($this->moduleName));
             $this->view->assign('functionMenuModuleContent', $this->getExtObjContent());
             // Setting up the buttons and markers for docheader
             $this->getButtons();
@@ -198,11 +200,13 @@ class InfoModuleController extends BaseScriptClass
     {
         $menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
         $menu->setIdentifier('WebInfoJumpMenu');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($this->MOD_MENU['function'] as $controller => $title) {
             $item = $menu
                 ->makeMenuItem()
                 ->setHref(
-                    BackendUtility::getModuleUrl(
+                    (string)$uriBuilder->buildUriFromRoute(
                         $this->moduleName,
                         [
                             'id' => $this->id,
diff --git a/typo3/sysext/info/Classes/Controller/InfoPageTyposcriptConfigController.php b/typo3/sysext/info/Classes/Controller/InfoPageTyposcriptConfigController.php
index 92f626eb5dae..5836b8844580 100644
--- a/typo3/sysext/info/Classes/Controller/InfoPageTyposcriptConfigController.php
+++ b/typo3/sysext/info/Classes/Controller/InfoPageTyposcriptConfigController.php
@@ -92,6 +92,8 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
     public function main()
     {
         $pageId = (int)(GeneralUtility::_GP('id'));
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
 
         if ($pageId === 0) {
             $this->view->assign('pageZero', 1);
@@ -125,7 +127,7 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
                                 'columnsOnly' => 'TSconfig',
                                 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                             ];
-                            $line['editIcon'] = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                            $line['editIcon'] = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                             $line['editTitle'] = 'editTSconfig';
                             $line['title'] = BackendUtility::wrapClickMenuOnIcon($icon, 'pages', $row['uid'])
                                 . ' ' . htmlspecialchars(BackendUtility::getRecordTitle('pages', $row));
@@ -147,7 +149,7 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
                         'columnsOnly' => 'TSconfig',
                         'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                     ];
-                    $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+                    $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
                     $editIcon = htmlspecialchars($url);
                     $editTitle = 'editTSconfig_all';
                 } else {
diff --git a/typo3/sysext/info/Classes/Controller/PageInformationController.php b/typo3/sysext/info/Classes/Controller/PageInformationController.php
index ab13758491d2..fa45c174c916 100644
--- a/typo3/sysext/info/Classes/Controller/PageInformationController.php
+++ b/typo3/sysext/info/Classes/Controller/PageInformationController.php
@@ -59,7 +59,9 @@ class PageInformationController extends \TYPO3\CMS\Backend\Module\AbstractFuncti
         $dblist = GeneralUtility::makeInstance(PageLayoutView::class);
         $dblist->descrTable = '_MOD_web_info';
         $dblist->thumbs = 0;
-        $dblist->script = BackendUtility::getModuleUrl('web_info');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $dblist->script = (string)$uriBuilder->buildUriFromRoute('web_info');
         $dblist->showIcon = 0;
         $dblist->setLMargin = 0;
         $dblist->agePrefixes = $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.minutesHoursDaysYears');
diff --git a/typo3/sysext/info/Classes/Controller/TranslationStatusController.php b/typo3/sysext/info/Classes/Controller/TranslationStatusController.php
index 7a2f1991296d..c44e63c9b3f3 100644
--- a/typo3/sysext/info/Classes/Controller/TranslationStatusController.php
+++ b/typo3/sysext/info/Classes/Controller/TranslationStatusController.php
@@ -130,6 +130,8 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
         $output = '';
         $newOL_js = [];
         $langRecUids = [];
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($tree->tree as $data) {
             $tCells = [];
             $langRecUids[0][] = $data['row']['uid'];
@@ -159,7 +161,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
                 $this->iconFactory->getIcon('actions-view', Icon::SIZE_SMALL)->render() . '</a>';
             $status = GeneralUtility::hideIfDefaultLanguage($data['row']['l18n_cfg']) ? 'danger' : 'success';
             // Create links:
-            $editUrl = BackendUtility::getModuleUrl('record_edit', [
+            $editUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                 'edit' => [
                     'pages' => [
                         $data['row']['uid'] => 'edit'
@@ -216,7 +218,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
                             ) . '">' . $info . '</a></td>';
                         // Edit whole record:
                         // Create links:
-                        $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                        $editUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                             'edit' => [
                                 'pages' => [
                                     $row['uid'] => 'edit'
@@ -267,7 +269,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
         $tCells = [];
         $tCells[] = '<td>' . $lang->sL('LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_page') . ':</td>';
         if (is_array($langRecUids[0])) {
-            $editUrl = BackendUtility::getModuleUrl('record_edit', [
+            $editUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                 'edit' => [
                     'pages' => [
                         implode(',', $langRecUids[0]) => 'edit'
@@ -292,7 +294,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
                 $tCells[] = '<td class="col-border-left">' . htmlspecialchars($langRow['title']) . '</td>';
                 // Edit language overlay records:
                 if (is_array($langRecUids[$langRow['uid']])) {
-                    $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                    $editUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', [
                         'edit' => [
                             'pages' => [
                                 implode(',', $langRecUids[$langRow['uid']]) => 'edit'
diff --git a/typo3/sysext/install/Classes/Report/InstallStatusReport.php b/typo3/sysext/install/Classes/Report/InstallStatusReport.php
index 018b92199272..ad24af09b7f3 100644
--- a/typo3/sysext/install/Classes/Report/InstallStatusReport.php
+++ b/typo3/sysext/install/Classes/Report/InstallStatusReport.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Install\Report;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Install\Service\Exception;
@@ -139,7 +138,8 @@ class InstallStatusReport implements \TYPO3\CMS\Reports\StatusProviderInterface
         $value = $languageService->getLL('status_updateComplete');
         $message = '';
         $severity = Status::OK;
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // check if there are update wizards left to perform
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'])) {
             $versionAsInt = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
@@ -149,7 +149,7 @@ class InstallStatusReport implements \TYPO3\CMS\Reports\StatusProviderInterface
                     // at least one wizard was found
                     $value = $languageService->getLL('status_updateIncomplete');
                     $severity = Status::WARNING;
-                    $url = BackendUtility::getModuleUrl('tools_toolsupgrade');
+                    $url = (string)$uriBuilder->buildUriFromRoute('tools_toolsupgrade');
                     $message = sprintf($languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:warning.install_update'), '<a href="' . htmlspecialchars($url) . '">', '</a>');
                     break;
                 }
diff --git a/typo3/sysext/install/Classes/Report/SecurityStatusReport.php b/typo3/sysext/install/Classes/Report/SecurityStatusReport.php
index 25e139ce8703..853d11a40111 100644
--- a/typo3/sysext/install/Classes/Report/SecurityStatusReport.php
+++ b/typo3/sysext/install/Classes/Report/SecurityStatusReport.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Install\Report;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Install\Service\EnableFileService;
 use TYPO3\CMS\Reports\Status;
@@ -59,7 +58,9 @@ class SecurityStatusReport implements \TYPO3\CMS\Reports\StatusProviderInterface
         if (!$validPassword) {
             $value = $GLOBALS['LANG']->getLL('status_insecure');
             $severity = Status::ERROR;
-            $changeInstallToolPasswordUrl = BackendUtility::getModuleUrl('tools_toolssettings');
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $changeInstallToolPasswordUrl = (string)$uriBuilder->buildUriFromRoute('tools_toolssettings');
             $message = sprintf(
                 $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:warning.installtool_default_password'),
                 '<a href="' . htmlspecialchars($changeInstallToolPasswordUrl) . '">',
diff --git a/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php b/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
index a4b12300f4f7..b0a8cb4d635a 100644
--- a/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
+++ b/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
@@ -545,7 +545,9 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
         $requestUri = GeneralUtility::getIndpEnv('REQUEST_URI') .
             '&id=' . $this->pObj->id .
             '&search_levels=' . $this->searchLevel;
-        $url = BackendUtility::getModuleUrl('record_edit', [
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $url = (string)$uriBuilder->buildUriFromRoute('record_edit', [
             'edit' => [
                 $table => [
                     $row['record_uid'] => 'edit'
diff --git a/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php b/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
index e6943f6e2a2e..e03a0e847e0d 100644
--- a/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
+++ b/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
@@ -19,7 +19,6 @@ use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Routing\Router;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
@@ -251,7 +250,9 @@ class ConfigurationController
         $menu->setIdentifier('tree');
         foreach ($this->treeSetup as $treeKey => $treeDetails) {
             $menuItem = $menu->makeMenuItem();
-            $menuItem->setHref(BackendUtility::getModuleUrl('system_config', ['tree' => $treeKey]))
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $menuItem->setHref((string)$uriBuilder->buildUriFromRoute('system_config', ['tree' => $treeKey]))
                 ->setTitle($languageService->sL(
                     'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:' . $treeDetails['label']
                 ));
diff --git a/typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php b/typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php
index d8934a9911e4..d3d6449aa072 100644
--- a/typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php
+++ b/typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php
@@ -262,12 +262,13 @@ class DatabaseIntegrityController
     {
         $menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
         $menu->setIdentifier('DatabaseJumpMenu');
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($this->MOD_MENU['function'] as $controller => $title) {
             $item = $menu
                 ->makeMenuItem()
                 ->setHref(
-                    BackendUtility::getModuleUrl(
+                    (string)$uriBuilder->buildUriFromRoute(
                         $this->moduleName,
                         [
                             'id' => 0,
@@ -293,8 +294,10 @@ class DatabaseIntegrityController
     {
         $modules = [];
         $availableModFuncs = ['records', 'relations', 'search', 'refindex'];
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($availableModFuncs as $modFunc) {
-            $modules[$modFunc] = BackendUtility::getModuleUrl('system_dbint') . '&SET[function]=' . $modFunc;
+            $modules[$modFunc] = (string)$uriBuilder->buildUriFromRoute('system_dbint') . '&SET[function]=' . $modFunc;
         }
         $this->view->assign('availableFunctions', $modules);
     }
@@ -431,10 +434,12 @@ class DatabaseIntegrityController
                     $theNumberOfRe = '';
                 }
                 $lr = '';
+                /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
                 if (is_array($admin->lRecords[$t])) {
                     foreach ($admin->lRecords[$t] as $data) {
                         if (!GeneralUtility::inList($admin->lostPagesList, $data['pid'])) {
-                            $lr .= '<div class="record"><a href="' . htmlspecialchars((BackendUtility::getModuleUrl('system_dbint') . '&SET[function]=records&fixLostRecords_table=' . $t . '&fixLostRecords_uid=' . $data['uid'])) . '" title="' . htmlspecialchars($lang->getLL('fixLostRecord')) . '">' . $this->iconFactory->getIcon('status-dialog-error', Icon::SIZE_SMALL)->render() . '</a>uid:' . $data['uid'] . ', pid:' . $data['pid'] . ', ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(strip_tags($data['title']), 20)) . '</div>';
+                            $lr .= '<div class="record"><a href="' . htmlspecialchars(((string)$uriBuilder->buildUriFromRoute('system_dbint') . '&SET[function]=records&fixLostRecords_table=' . $t . '&fixLostRecords_uid=' . $data['uid'])) . '" title="' . htmlspecialchars($lang->getLL('fixLostRecord')) . '">' . $this->iconFactory->getIcon('status-dialog-error', Icon::SIZE_SMALL)->render() . '</a>uid:' . $data['uid'] . ', pid:' . $data['pid'] . ', ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(strip_tags($data['title']), 20)) . '</div>';
                         } else {
                             $lr .= '<div class="record-noicon">uid:' . $data['uid'] . ', pid:' . $data['pid'] . ', ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(strip_tags($data['title']), 20)) . '</div>';
                         }
diff --git a/typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php b/typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php
index a7051053c318..2729b11f923b 100644
--- a/typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php
+++ b/typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Lowlevel\Utility;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 
@@ -98,6 +97,8 @@ class ArrayBrowser
         if ($positionKey) {
             $positionKey = $positionKey . '.';
         }
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($array as $key => $value) {
             $depth = $positionKey . $key;
             if (is_object($value) && !$value instanceof \Traversable) {
@@ -109,7 +110,7 @@ class ArrayBrowser
             $output .= '<li' . ($isResult ? ' class="active"' : '') . '>';
             if ($isArray && !$this->expAll) {
                 $goto = 'a' . substr(md5($depth), 0, 6);
-                $output .= '<a class="list-tree-control' . ($isExpanded ? ' list-tree-control-open' : ' list-tree-control-closed') . '" id="' . $goto . '" href="' . htmlspecialchars((BackendUtility::getModuleUrl(GeneralUtility::_GP('route')) . '&node[' . $depth . ']=' . ($isExpanded ? 0 : 1) . '#' . $goto)) . '"><i class="fa"></i></a> ';
+                $output .= '<a class="list-tree-control' . ($isExpanded ? ' list-tree-control-open' : ' list-tree-control-closed') . '" id="' . $goto . '" href="' . htmlspecialchars(((string)$uriBuilder->buildUriFromRoutePath(GeneralUtility::_GP('route')) . '&node[' . $depth . ']=' . ($isExpanded ? 0 : 1) . '#' . $goto)) . '"><i class="fa"></i></a> ';
             }
             $output .= '<span class="list-tree-group">';
             $output .= $this->wrapArrayKey($key, $depth, !$isArray ? $value : '');
@@ -141,7 +142,8 @@ class ArrayBrowser
     {
         // Protect label:
         $label = htmlspecialchars($label);
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // If varname is set:
         if ($this->varName && !$this->dontLinkVar) {
             $variableName = $this->varName
@@ -149,7 +151,7 @@ class ArrayBrowser
                 . (!MathUtility::canBeInterpretedAsInteger($theValue) ? '\''
                 . addslashes($theValue) . '\'' : $theValue) . '; ';
             $label = '<a class="list-tree-label" href="'
-                . htmlspecialchars((BackendUtility::getModuleUrl(GeneralUtility::_GP('route'))
+                . htmlspecialchars(((string)$uriBuilder->buildUriFromRoutePath(GeneralUtility::_GP('route'))
                 . '&varname=' . urlencode($variableName)))
                 . '#varname">' . $label . '</a>';
         }
diff --git a/typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php b/typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php
index b3e8a09f901a..99580dbc4008 100644
--- a/typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php
+++ b/typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php
@@ -138,7 +138,9 @@ class OpendocsToolbarItem implements ToolbarItemInterface
         $result['record'] = $record;
         $label = htmlspecialchars(strip_tags(htmlspecialchars_decode($document[0])));
         $result['label'] = $label;
-        $link = BackendUtility::getModuleUrl('record_edit') . '&' . $document[2];
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $link = (string)$uriBuilder->buildUriFromRoute('record_edit') . '&' . $document[2];
         $pageId = (int)$document[3]['uid'];
         if ($document[3]['table'] !== 'pages') {
             $pageId = (int)$document[3]['pid'];
diff --git a/typo3/sysext/recordlist/Classes/Browser/FileBrowser.php b/typo3/sysext/recordlist/Classes/Browser/FileBrowser.php
index b9c8b518531a..05cba7576a9c 100644
--- a/typo3/sysext/recordlist/Classes/Browser/FileBrowser.php
+++ b/typo3/sysext/recordlist/Classes/Browser/FileBrowser.php
@@ -330,8 +330,10 @@ class FileBrowser extends AbstractElementBrowser implements ElementBrowserInterf
                 $ATag_e = '';
                 $bulkCheckBox = '';
             }
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
             // Create link to showing details about the file in a window:
-            $Ahref = BackendUtility::getModuleUrl('show_item', [
+            $Ahref = (string)$uriBuilder->buildUriFromRoute('show_item', [
                 'type' => 'file',
                 'table' => '_FILE',
                 'uid' => $fileObject->getCombinedIdentifier(),
diff --git a/typo3/sysext/recordlist/Classes/Controller/ElementBrowserController.php b/typo3/sysext/recordlist/Classes/Controller/ElementBrowserController.php
index 8d77b88c1ca9..b0c563c7de55 100644
--- a/typo3/sysext/recordlist/Classes/Controller/ElementBrowserController.php
+++ b/typo3/sysext/recordlist/Classes/Controller/ElementBrowserController.php
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Recordlist\Controller;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -84,7 +83,9 @@ class ElementBrowserController
     {
         // Fallback for old calls, which use mode "wizard" or "rte" for link selection
         if ($this->mode === 'wizard' || $this->mode === 'rte') {
-            return $response->withStatus(303)->withHeader('Location', BackendUtility::getModuleUrl('wizard_link', $_GET));
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            return $response->withStatus(303)->withHeader('Location', (string)$uriBuilder->buildUriFromRoute('wizard_link', $_GET));
         }
 
         $response->getBody()->write($this->main());
diff --git a/typo3/sysext/recordlist/Classes/Controller/ElementBrowserFramesetController.php b/typo3/sysext/recordlist/Classes/Controller/ElementBrowserFramesetController.php
index 9422d7b54a51..bc11b7b024f5 100644
--- a/typo3/sysext/recordlist/Classes/Controller/ElementBrowserFramesetController.php
+++ b/typo3/sysext/recordlist/Classes/Controller/ElementBrowserFramesetController.php
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Recordlist\Controller;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -72,7 +71,9 @@ class ElementBrowserFramesetController
         // Setting GPvars:
         $mode = GeneralUtility::_GP('mode');
         $bparams = GeneralUtility::_GP('bparams');
-        $moduleUrl = BackendUtility::getModuleUrl('wizard_element_browser') . '&mode=';
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $moduleUrl = (string)$uriBuilder->buildUriFromRoute('wizard_element_browser') . '&mode=';
         $documentTemplate = $this->getDocumentTemplate();
         $documentTemplate->JScode = GeneralUtility::wrapJS('
 				function closing() {	//
@@ -98,7 +99,7 @@ class ElementBrowserFramesetController
         $this->content = $this->getPageRenderer()->render(PageRenderer::PART_HEADER) .
             '<frameset rows="*,1" framespacing="0" frameborder="0" border="0">
 				<frame name="content" src="' . htmlspecialchars($url) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
-				<frame name="menu" src="' . htmlspecialchars(BackendUtility::getModuleUrl('dummy')) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
+				<frame name="menu" src="' . htmlspecialchars((string)$uriBuilder->buildUriFromRoute('dummy')) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
 			</frameset>
 		</html>
 		';
diff --git a/typo3/sysext/recordlist/Classes/RecordList.php b/typo3/sysext/recordlist/Classes/RecordList.php
index cd8c5fb15e39..feb487a1ab61 100644
--- a/typo3/sysext/recordlist/Classes/RecordList.php
+++ b/typo3/sysext/recordlist/Classes/RecordList.php
@@ -312,7 +312,9 @@ class RecordList
         // Initialize the dblist object:
         /** @var $dblist RecordList\DatabaseRecordList */
         $dblist = GeneralUtility::makeInstance(RecordList\DatabaseRecordList::class);
-        $dblist->script = BackendUtility::getModuleUrl('web_list');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $dblist->script = (string)$uriBuilder->buildUriFromRoute('web_list');
         $dblist->calcPerms = $calcPerms;
         $dblist->thumbs = $backendUser->uc['thumbnailsByDefault'];
         $dblist->returnUrl = $this->returnUrl;
@@ -421,7 +423,7 @@ class RecordList
 				' . $this->moduleTemplate->redirectUrls($listUrl) . '
 				' . $dblist->CBfunctions() . '
 				function editRecords(table,idList,addParams,CBflag) {	//
-					window.location.href="' . BackendUtility::getModuleUrl('record_edit', ['returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]) . '&edit["+table+"]["+idList+"]=edit"+addParams;
+					window.location.href="' . (string)$uriBuilder->buildUriFromRoute('record_edit', ['returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]) . '&edit["+table+"]["+idList+"]=edit"+addParams;
 				}
 				function editList(table,idList) {	//
 					var list="";
@@ -715,7 +717,9 @@ class RecordList
                         'justLocalized' => 'pages:' . $id . ':' . $languageUid,
                         'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                     ];
-                    $redirectUrl = BackendUtility::getModuleUrl('record_edit', $parameters);
+                    /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                    $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+                    $redirectUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
                     $targetUrl = BackendUtility::getLinkToDataHandlerAction(
                         '&cmd[pages][' . $id . '][localize]=' . $languageUid,
                         $redirectUrl
diff --git a/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php b/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
index 856f281705f1..ba24e0143262 100644
--- a/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
+++ b/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
@@ -1330,7 +1330,9 @@ class AbstractDatabaseRecordList extends AbstractRecordList
             if ($localizedRecordUid !== false) {
                 // Create parameters and finally run the classic page module for creating a new page translation
                 $url = $this->listURL();
-                $editUserAccountUrl = BackendUtility::getModuleUrl(
+                /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+                $editUserAccountUrl = (string)$uriBuilder->buildUriFromRoute(
                     'record_edit',
                     [
                         'edit[' . $table . '][' . $localizedRecordUid . ']' => 'edit',
diff --git a/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php b/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
index 1018922b0ac6..4017eec0df82 100644
--- a/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
+++ b/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
@@ -637,6 +637,8 @@ class DatabaseRecordList
             'csv' => '',
             'export' => ''
         ];
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Get users permissions for this page record:
         $localCalcPerms = $backendUser->calcPerms($this->pageRow);
         // CSH
@@ -667,7 +669,7 @@ class DatabaseRecordList
             }
             // New record on pages that are not locked by editlock
             if (!$module->modTSconfig['properties']['noCreateRecordsLink'] && $this->editLockPermissions()) {
-                $onClick = htmlspecialchars('return jumpExt(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', ['id' => $this->id])) . ');');
+                $onClick = htmlspecialchars('return jumpExt(' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('db_new', ['id' => $this->id])) . ');');
                 $buttons['new_record'] = '<a href="#" onclick="' . $onClick . '" title="'
                     . htmlspecialchars($lang->getLL('newRecordGeneral')) . '">'
                     . $this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL)->render() . '</a>';
@@ -713,7 +715,7 @@ class DatabaseRecordList
                     . $this->iconFactory->getIcon('actions-document-export-csv', Icon::SIZE_SMALL)->render() . '</a>';
                 // Export
                 if (ExtensionManagementUtility::isLoaded('impexp')) {
-                    $url = BackendUtility::getModuleUrl('xMOD_tximpexp', ['tx_impexp[action]' => 'export']);
+                    $url = (string)$uriBuilder->buildUriFromRoute('xMOD_tximpexp', ['tx_impexp[action]' => 'export']);
                     $buttons['export'] = '<a href="' . htmlspecialchars($url . '&tx_impexp[list][]='
                             . rawurlencode($this->table . ':' . $this->id)) . '" title="'
                         . htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.export')) . '">'
@@ -757,6 +759,8 @@ class DatabaseRecordList
         $lang = $this->getLanguageService();
         // Get users permissions for this page record:
         $localCalcPerms = $backendUser->calcPerms($this->pageRow);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // CSH
         if ((string)$this->id === '') {
             $fieldName = 'list_module_noId';
@@ -783,7 +787,7 @@ class DatabaseRecordList
             }
             // New record on pages that are not locked by editlock
             if (!$module->modTSconfig['properties']['noCreateRecordsLink'] && $this->editLockPermissions()) {
-                $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', ['id' => $this->id])) . ');';
+                $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('db_new', ['id' => $this->id])) . ');';
                 $newRecordButton = $buttonBar->makeLinkButton()
                     ->setHref('#')
                     ->setOnClick($onClick)
@@ -849,7 +853,7 @@ class DatabaseRecordList
                 $buttonBar->addButton($csvButton, ButtonBar::BUTTON_POSITION_LEFT, 40);
                 // Export
                 if (ExtensionManagementUtility::isLoaded('impexp')) {
-                    $url = BackendUtility::getModuleUrl('xMOD_tximpexp', ['tx_impexp[action]' => 'export']);
+                    $url = (string)$uriBuilder->buildUriFromRoute('xMOD_tximpexp', ['tx_impexp[action]' => 'export']);
                     $exportButton = $buttonBar->makeLinkButton()
                         ->setHref($url . '&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id))
                         ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.export'))
@@ -1533,6 +1537,8 @@ class DatabaseRecordList
         // Init:
         $theData = [];
         $icon = '';
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Traverse the fields:
         foreach ($this->fieldArray as $fCol) {
             // Calculate users permissions to edit records in the table:
@@ -1581,7 +1587,7 @@ class DatabaseRecordList
                         $spriteIcon = $this->iconFactory->getIcon('actions-edit-copy', Icon::SIZE_SMALL)->render();
                         $cells['copyMarked'] = $this->linkClipboardHeaderIcon($spriteIcon, $table, 'setCB', '', $lang->getLL('clip_selectMarked'));
                         // The "edit marked" link:
-                        $editUri = BackendUtility::getModuleUrl('record_edit')
+                        $editUri = (string)$uriBuilder->buildUriFromRoute('record_edit')
                             . '&edit[' . $table . '][{entityIdentifiers:editList}]=edit'
                             . '&returnUrl={T3_THIS_LOCATION}';
                         $cells['edit'] = '<a class="btn btn-default t3js-record-edit-multiple" href="#"'
@@ -1640,14 +1646,14 @@ class DatabaseRecordList
                                 $newContentElementWizard = isset($tmpTSc['properties']['newContentElementWizard.']['override'])
                                     ? $tmpTSc['properties']['newContentElementWizard.']['override']
                                     : 'new_content_element';
-                                $newContentWizScriptPath = BackendUtility::getModuleUrl($newContentElementWizard, ['id' => $this->id]);
+                                $newContentWizScriptPath = (string)$uriBuilder->buildUriFromRoute($newContentElementWizard, ['id' => $this->id]);
 
                                 $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($newContentWizScriptPath) . ');';
                                 $icon = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
                                     . htmlspecialchars($lang->getLL('new')) . '">' . $spriteIcon->render() . '</a>';
                             } elseif ($table === 'pages' && $this->newWizards) {
                                 $parameters = ['id' => $this->id, 'pagesOnly' => 1, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
-                                $href = BackendUtility::getModuleUrl('db_new', $parameters);
+                                $href = (string)$uriBuilder->buildUriFromRoute('db_new', $parameters);
                                 $icon = '<a class="btn btn-default" href="' . htmlspecialchars($href) . '" title="' . htmlspecialchars($lang->getLL('new')) . '">'
                                     . $spriteIcon->render() . '</a>';
                             } else {
@@ -1665,7 +1671,7 @@ class DatabaseRecordList
                             if ($this->clipNumPane()) {
                                 $entityIdentifiers .= ':editList';
                             }
-                            $editUri = BackendUtility::getModuleUrl('record_edit')
+                            $editUri = (string)$uriBuilder->buildUriFromRoute('record_edit')
                                 . '&edit[' . $table . '][{' . $entityIdentifiers . '}]=edit'
                                 . '&columnsOnly=' . implode(',', $this->fieldArray)
                                 . '&returnUrl={T3_THIS_LOCATION}';
@@ -1709,7 +1715,7 @@ class DatabaseRecordList
                             if ($this->clipNumPane()) {
                                 $entityIdentifiers .= ':editList';
                             }
-                            $editUri = BackendUtility::getModuleUrl('record_edit')
+                            $editUri = (string)$uriBuilder->buildUriFromRoute('record_edit')
                                 . '&edit[' . $table . '][{' . $entityIdentifiers . '}]=edit'
                                 . '&columnsOnly=' . $fCol
                                 . '&returnUrl={T3_THIS_LOCATION}';
@@ -1897,6 +1903,9 @@ class DatabaseRecordList
                         && $this->getBackendUserAuthentication()->recordEditAccessInternals($table, $row);
         $permsEdit = $this->overlayEditLockPermissions($table, $row, $permsEdit);
         // "Show" link (only pages and tt_content elements)
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         if ($table === 'pages' || $table === 'tt_content') {
             $onClick = $this->getOnClickForRow($table, $row);
             $viewAction = '<a class="btn btn-default" href="#" onclick="'
@@ -1935,7 +1944,7 @@ class DatabaseRecordList
             if ($isL10nOverlay) {
                 $moveAction = $this->spaceIcon;
             } else {
-                $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('move_element') . '&table=' . $table . '&uid=' . $row['uid']) . ');';
+                $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('move_element') . '&table=' . $table . '&uid=' . $row['uid']) . ');';
                 $linkTitleLL = htmlspecialchars($this->getLanguageService()->getLL('move_' . ($table === 'tt_content' ? 'record' : 'page')));
                 $icon = ($table === 'pages' ? $this->iconFactory->getIcon('actions-page-move', Icon::SIZE_SMALL) : $this->iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL));
                 $moveAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $linkTitleLL . '">' . $icon->render() . '</a>';
@@ -1945,7 +1954,7 @@ class DatabaseRecordList
         // If the table is NOT a read-only table, then show these links:
         if ($this->isEditable($table)) {
             // "Revert" link (history/undo)
-            $moduleUrl = BackendUtility::getModuleUrl('record_history', ['element' => $table . ':' . $row['uid']]);
+            $moduleUrl = (string)$uriBuilder->buildUriFromRoute('record_history', ['element' => $table . ':' . $row['uid']]);
             $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($moduleUrl) . ',\'#latest\');';
             $historyAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
                 . htmlspecialchars($this->getLanguageService()->getLL('history')) . '">'
@@ -1956,7 +1965,7 @@ class DatabaseRecordList
                 if ($isL10nOverlay) {
                     $permsAction = $this->spaceIcon;
                 } else {
-                    $href = BackendUtility::getModuleUrl('system_BeuserTxPermission') . '&id=' . $row['uid'] . '&tx_beuser_system_beusertxpermission[action]=edit' . $this->makeReturnUrl();
+                    $href = (string)$uriBuilder->buildUriFromRoute('system_BeuserTxPermission') . '&id=' . $row['uid'] . '&tx_beuser_system_beusertxpermission[action]=edit' . $this->makeReturnUrl();
                     $permsAction = '<a class="btn btn-default" href="' . htmlspecialchars($href) . '" title="'
                         . htmlspecialchars($this->getLanguageService()->getLL('permissions')) . '">'
                         . $this->iconFactory->getIcon('actions-lock', Icon::SIZE_SMALL)->render() . '</a>';
@@ -3743,7 +3752,10 @@ class DatabaseRecordList
             if ($localizedRecordUid !== false) {
                 // Create parameters and finally run the classic page module for creating a new page translation
                 $url = $this->listURL();
-                $editUserAccountUrl = BackendUtility::getModuleUrl(
+                /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
+                $editUserAccountUrl = (string)$uriBuilder->buildUriFromRoute(
                     'record_edit',
                     [
                         'edit[' . $table . '][' . $localizedRecordUid . ']' => 'edit',
diff --git a/typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php b/typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php
index ca212c1e6e70..f88cf3e331a4 100644
--- a/typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php
+++ b/typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Recordlist\View;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Resource\Folder;
@@ -63,7 +62,9 @@ class FolderUtilityRenderer
         }
         $lang = $this->getLanguageService();
 
-        $formAction = BackendUtility::getModuleUrl('tce_file');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $formAction = (string)$uriBuilder->buildUriFromRoute('tce_file');
         $markup = [];
         $markup[] = '<form action="' . htmlspecialchars($formAction)
             . '" method="post" name="editform" enctype="multipart/form-data">';
@@ -130,7 +131,9 @@ class FolderUtilityRenderer
                     . strtoupper(htmlspecialchars($fileExt)) . '</span>';
             }
         }
-        $formAction = BackendUtility::getModuleUrl('tce_file');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $formAction = (string)$uriBuilder->buildUriFromRoute('tce_file');
         $combinedIdentifier = $folderObject->getCombinedIdentifier();
         $markup = [];
         $markup[] = '<form action="' . htmlspecialchars($formAction)
@@ -191,7 +194,7 @@ class FolderUtilityRenderer
             }
         }
         if (!empty($fileExtList)) {
-            $formAction = BackendUtility::getModuleUrl('online_media');
+            $formAction = (string)$uriBuilder->buildUriFromRoute('online_media');
 
             $markup = [];
             $markup[] = '<form action="' . htmlspecialchars($formAction)
diff --git a/typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php b/typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
index 101a3c832eae..7c57f991507d 100644
--- a/typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
+++ b/typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
@@ -71,10 +71,12 @@ class ConfigurationStatus implements StatusProviderInterface
 
         $registry = GeneralUtility::makeInstance(Registry::class);
         $lastRefIndexUpdate = $registry->get('core', 'sys_refindex_lastUpdate');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         if (!$count && $lastRefIndexUpdate) {
             $value = $this->getLanguageService()->getLL('status_empty');
             $severity = ReportStatus::WARNING;
-            $url =  BackendUtility::getModuleUrl('system_dbint') . '&id=0&SET[function]=refindex';
+            $url =  (string)$uriBuilder->buildUriFromRoute('system_dbint') . '&id=0&SET[function]=refindex';
             $message = sprintf($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:warning.backend_reference_index'), '<a href="' . htmlspecialchars($url) . '">', '</a>', BackendUtility::datetime($lastRefIndexUpdate));
         }
         return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_referenceIndex'), $value, $message, $severity);
diff --git a/typo3/sysext/reports/Classes/Report/Status/SecurityStatus.php b/typo3/sysext/reports/Classes/Report/Status/SecurityStatus.php
index 2beb0f053e58..33a354a9da8a 100644
--- a/typo3/sysext/reports/Classes/Report/Status/SecurityStatus.php
+++ b/typo3/sysext/reports/Classes/Report/Status/SecurityStatus.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Reports\Report\Status;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
 use TYPO3\CMS\Core\Localization\LanguageService;
@@ -108,13 +107,15 @@ class SecurityStatus implements StatusProviderInterface
                 $secure = false;
             }
             if (!$secure) {
+                /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
                 $value = $this->getLanguageService()->getLL('status_insecure');
                 $severity = ReportStatus::ERROR;
-                $editUserAccountUrl = BackendUtility::getModuleUrl(
+                $editUserAccountUrl = (string)$uriBuilder->buildUriFromRoute(
                     'record_edit',
                     [
                         'edit[be_users][' . $row['uid'] . ']' => 'edit',
-                        'returnUrl' => BackendUtility::getModuleUrl('system_ReportsTxreportsm1')
+                        'returnUrl' => (string)$uriBuilder->buildUriFromRoute('system_ReportsTxreportsm1')
                     ]
                 );
                 $message = sprintf(
diff --git a/typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php b/typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
index df78f2fd2ef0..8915fece5602 100644
--- a/typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
+++ b/typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
@@ -131,7 +131,9 @@ class SchedulerModuleController
         $this->view = GeneralUtility::makeInstance(StandaloneView::class);
         $this->view->getRequest()->setControllerExtensionName('scheduler');
         $this->view->setPartialRootPaths([ExtensionManagementUtility::extPath('scheduler') . 'Resources/Private/Partials/Backend/SchedulerModule/']);
-        $this->moduleUri = BackendUtility::getModuleUrl('system_txschedulerM1');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $this->moduleUri = (string)$uriBuilder->buildUriFromRoute('system_txschedulerM1');
         $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
         $this->scheduler = GeneralUtility::makeInstance(Scheduler::class);
 
@@ -188,12 +190,13 @@ class SchedulerModuleController
     {
         $menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
         $menu->setIdentifier('SchedulerJumpMenu');
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($this->MOD_MENU['function'] as $controller => $title) {
             $item = $menu
                 ->makeMenuItem()
                 ->setHref(
-                    BackendUtility::getModuleUrl(
+                    (string)$uriBuilder->buildUriFromRoute(
                         'system_txschedulerM1',
                         [
                             'id' => 0,
@@ -730,7 +733,9 @@ class SchedulerModuleController
     protected function getBrowseButton($fieldID, array $fieldInfo)
     {
         if (isset($fieldInfo['browser']) && ($fieldInfo['browser'] === 'page')) {
-            $url = BackendUtility::getModuleUrl(
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $url = (string)$uriBuilder->buildUriFromRoute(
                 'wizard_element_browser',
                 ['mode' => 'db', 'bparams' => $fieldID . '|||pages|']
             );
diff --git a/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php b/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php
index 5514b93c81e7..9384f22bdaae 100644
--- a/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php
+++ b/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php
@@ -14,7 +14,7 @@ namespace TYPO3\CMS\Scheduler\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
@@ -56,6 +56,8 @@ class ModuleLinkViewHelper extends AbstractViewHelper
             $moduleArguments['tx_scheduler'] = $arguments['arguments'];
         }
 
-        return BackendUtility::getModuleUrl('system_txschedulerM1', $moduleArguments);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('system_txschedulerM1', $moduleArguments);
     }
 }
diff --git a/typo3/sysext/setup/Classes/Controller/SetupModuleController.php b/typo3/sysext/setup/Classes/Controller/SetupModuleController.php
index 128fe2b38ef0..a3a8d89322f1 100644
--- a/typo3/sysext/setup/Classes/Controller/SetupModuleController.php
+++ b/typo3/sysext/setup/Classes/Controller/SetupModuleController.php
@@ -374,7 +374,9 @@ class SetupModuleController
      */
     public function main()
     {
-        $this->content .= '<form action="' . BackendUtility::getModuleUrl('user_setup') . '" method="post" id="SetupModuleController" name="usersetup" enctype="multipart/form-data">';
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $this->content .= '<form action="' . (string)$uriBuilder->buildUriFromRoute('user_setup') . '" method="post" id="SetupModuleController" name="usersetup" enctype="multipart/form-data">';
         if ($this->languageUpdate) {
             $this->moduleTemplate->addJavaScriptCode('languageUpdate', '
                 if (top && top.TYPO3.ModuleMenu.App) {
@@ -788,7 +790,9 @@ class SetupModuleController
                 $opt[] = '<option value="' . (int)$rr['uid'] . '"' . ($this->simUser === (int)$rr['uid'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
             }
             if (!empty($opt)) {
-                $this->simulateSelector = '<select id="field_simulate" class="form-control" name="simulateUser" onchange="window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('user_setup') . '&simUser=') . '+this.options[this.selectedIndex].value;"><option></option>' . implode('', $opt) . '</select>';
+                /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+                $this->simulateSelector = '<select id="field_simulate" class="form-control" name="simulateUser" onchange="window.location.href=' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('user_setup') . '&simUser=') . '+this.options[this.selectedIndex].value;"><option></option>' . implode('', $opt) . '</select>';
             }
         }
         // This can only be set if the previous code was executed.
@@ -1049,11 +1053,13 @@ class SetupModuleController
      */
     protected function addAvatarButtonJs($fieldName)
     {
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         $this->moduleTemplate->addJavaScriptCode('avatar-button', '
             var browserWin="";
 
             function openFileBrowser() {
-                var url = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('wizard_element_browser', ['mode' => 'file', 'bparams' => '||||dummy|setFileUid'])) . ';
+                var url = ' . GeneralUtility::quoteJSvalue((string)$uriBuilder->buildUriFromRoute('wizard_element_browser', ['mode' => 'file', 'bparams' => '||||dummy|setFileUid'])) . ';
                 browserWin = window.open(url,"Typo3WinBrowser","height=650,width=800,status=0,menubar=0,resizable=1,scrollbars=1");
                 browserWin.focus();
             }
diff --git a/typo3/sysext/sys_action/Classes/ActionList.php b/typo3/sysext/sys_action/Classes/ActionList.php
index 522ca2b1c618..2ebc09082edf 100644
--- a/typo3/sysext/sys_action/Classes/ActionList.php
+++ b/typo3/sysext/sys_action/Classes/ActionList.php
@@ -14,6 +14,8 @@ namespace TYPO3\CMS\SysAction;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * Class for the list rendering of Web>Task Center module
  */
@@ -72,6 +74,8 @@ class ActionList extends \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList
         if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('show')) {
             $urlParameters['show'] = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('show');
         }
-        return \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('user_task', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('user_task', $urlParameters);
     }
 }
diff --git a/typo3/sysext/sys_action/Classes/ActionTask.php b/typo3/sysext/sys_action/Classes/ActionTask.php
index 4cc4c961a34a..7a7581bea17e 100644
--- a/typo3/sysext/sys_action/Classes/ActionTask.php
+++ b/typo3/sysext/sys_action/Classes/ActionTask.php
@@ -64,7 +64,9 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
     public function __construct(\TYPO3\CMS\Taskcenter\Controller\TaskModuleController $taskObject)
     {
         $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
-        $this->moduleUrl = BackendUtility::getModuleUrl('user_task');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $this->moduleUrl = (string)$uriBuilder->buildUriFromRoute('user_task');
         $this->taskObject = $taskObject;
         $this->getLanguageService()->includeLLFile('EXT:sys_action/Resources/Private/Language/locallang.xlf');
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sys_action']['tx_sysaction_task'] ?? [] as $className) {
@@ -216,7 +218,8 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                 )
                 ->groupBy('sys_action.uid');
         }
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         $queryResult = $queryBuilder->execute();
         while ($actionRow = $queryResult->fetch()) {
             $editActionLink = '';
@@ -225,7 +228,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
             if ($this->getBackendUser()->isAdmin()) {
                 $uidEditArgument = 'edit[sys_action][' . (int)$actionRow['uid'] . ']';
 
-                $link = BackendUtility::getModuleUrl(
+                $link = (string)$uriBuilder->buildUriFromRoute(
                     'record_edit',
                     [
                         $uidEditArgument => 'edit',
@@ -281,7 +284,9 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
         }
         // Admin users can create a new action
         if ($this->getBackendUser()->isAdmin()) {
-            $link = BackendUtility::getModuleUrl(
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $link = (string)$uriBuilder->buildUriFromRoute(
                 'record_edit',
                 [
                     'edit[sys_action][0]' => 'new',
@@ -724,7 +729,9 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
      */
     protected function viewNewRecord($record)
     {
-        $link = BackendUtility::getModuleUrl(
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $link = (string)$uriBuilder->buildUriFromRoute(
             'record_edit',
             [
                 'edit[' . $record['t3_tables'] . '][' . (int)$record['t3_listPid'] . ']' => 'new',
@@ -758,7 +765,9 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
             if (isset($record['crdate'])) {
                 $description .= ' - ' . BackendUtility::dateTimeAge($record['crdate']);
             }
-            $link = BackendUtility::getModuleUrl(
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $link = (string)$uriBuilder->buildUriFromRoute(
                 'record_edit',
                 [
                     'edit[' . $el['table'] . '][' . $el['id'] . ']' => 'edit',
@@ -834,8 +843,10 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                     if (!$queryIsEmpty) {
                         $actionContent .= '<div class="panel panel-default"><div class="panel-body"><pre>' . $sql_query['qSelect'] . '</pre></div></div>';
                     }
+                    /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                    $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
                     $actionContent .= '<a title="' . $this->getLanguageService()->getLL('action_editQuery') . '" class="btn btn-default" href="'
-                        . htmlspecialchars(BackendUtility::getModuleUrl('system_dbint')
+                        . htmlspecialchars((string)$uriBuilder->buildUriFromRoute('system_dbint')
                             . '&id=' . '&SET[function]=search' . '&SET[search]=query'
                             . '&storeControl[STORE]=-' . $record['uid'] . '&storeControl[LOAD]=1')
                         . '">'
@@ -910,6 +921,8 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
             $dblist->setDispFields();
             // Render the list of tables:
             $dblist->generateList();
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
             // Add JavaScript functions to the page:
             $this->taskObject->getModuleTemplate()->addJavaScriptCode(
                 'ActionTaskInlineJavascript',
@@ -936,7 +949,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
 
 				' . $dblist->CBfunctions() . '
 				function editRecords(table,idList,addParams,CBflag) {
-					window.location.href="' . BackendUtility::getModuleUrl('record_edit', ['returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]) . '&edit["+table+"]["+idList+"]=edit"+addParams;
+					window.location.href="' . (string)$uriBuilder->buildUriFromRoute('record_edit', ['returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]) . '&edit["+table+"]["+idList+"]=edit"+addParams;
 				}
 				function editList(table,idList) {
 					var list="";
diff --git a/typo3/sysext/sys_action/Classes/Backend/ToolbarItems/ActionToolbarItem.php b/typo3/sysext/sys_action/Classes/Backend/ToolbarItems/ActionToolbarItem.php
index 5134cdd2c9d4..e7490d0e3d48 100644
--- a/typo3/sysext/sys_action/Classes/Backend/ToolbarItems/ActionToolbarItem.php
+++ b/typo3/sysext/sys_action/Classes/Backend/ToolbarItems/ActionToolbarItem.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\SysAction\Backend\ToolbarItems;
  */
 
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
@@ -114,11 +113,13 @@ class ActionToolbarItem implements ToolbarItemInterface
                 ->groupBy('sys_action.uid');
         }
 
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         $result = $queryBuilder->execute();
         while ($actionRow = $result->fetch()) {
             $actionRow['link'] = sprintf(
                 '%s&SET[mode]=tasks&SET[function]=sys_action.%s&show=%u',
-                BackendUtility::getModuleUrl('user_task'),
+                (string)$uriBuilder->buildUriFromRoute('user_task'),
                 ActionTask::class, // @todo: class name string is hand over as url parameter?!
                 $actionRow['uid']
             );
diff --git a/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php b/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php
index 2c14c483bd98..70a46f45ccf2 100644
--- a/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php
+++ b/typo3/sysext/sys_note/Classes/ViewHelpers/DeleteLinkViewHelper.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\SysNote\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
@@ -53,6 +52,8 @@ class DeleteLinkViewHelper extends AbstractViewHelper
             'cmd[sys_note][' . $arguments['id'] . '][delete]' => 1,
             'redirect' => GeneralUtility::getIndpEnv('REQUEST_URI')
         ];
-        return BackendUtility::getModuleUrl('tce_db', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('tce_db', $urlParameters);
     }
 }
diff --git a/typo3/sysext/sys_note/Classes/ViewHelpers/EditLinkViewHelper.php b/typo3/sysext/sys_note/Classes/ViewHelpers/EditLinkViewHelper.php
index bb4af63957b2..94a83dc4cf81 100644
--- a/typo3/sysext/sys_note/Classes/ViewHelpers/EditLinkViewHelper.php
+++ b/typo3/sysext/sys_note/Classes/ViewHelpers/EditLinkViewHelper.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\SysNote\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
@@ -46,7 +45,9 @@ class EditLinkViewHelper extends AbstractViewHelper
      */
     public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
     {
-        return BackendUtility::getModuleUrl(
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute(
             'record_edit',
             [
                 'edit[sys_note][' . $arguments['id'] . ']' => 'edit',
diff --git a/typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php b/typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php
index 6a3e64cb5928..eb260c94bb03 100644
--- a/typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php
+++ b/typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php
@@ -90,11 +90,13 @@ class TaskModuleController extends BaseScriptClass
     {
         $menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
         $menu->setIdentifier('WebFuncJumpMenu');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($this->MOD_MENU['mode'] as $controller => $title) {
             $item = $menu
                 ->makeMenuItem()
                 ->setHref(
-                    BackendUtility::getModuleUrl(
+                    (string)$uriBuilder->buildUriFromRoute(
                         $this->moduleName,
                         [
                             'id' => $this->id,
@@ -349,6 +351,8 @@ class TaskModuleController extends BaseScriptClass
         $content = '';
         $tasks = [];
         $defaultIcon = 'EXT:taskcenter/Resources/Public/Icons/module-taskcenter.svg';
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Render the tasks only if there are any available
         if (count($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'] ?? [])) {
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'] as $extKey => $extensionReports) {
@@ -356,7 +360,7 @@ class TaskModuleController extends BaseScriptClass
                     if (!$this->checkAccess($extKey, $taskClass)) {
                         continue;
                     }
-                    $link = BackendUtility::getModuleUrl('user_task') . '&SET[function]=' . $extKey . '.' . $taskClass;
+                    $link = (string)$uriBuilder->buildUriFromRoute('user_task') . '&SET[function]=' . $extKey . '.' . $taskClass;
                     $taskTitle = $this->getLanguageService()->sL($task['title']);
                     $taskDescriptionHtml = '';
 
diff --git a/typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php b/typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
index dc63c0f72a78..1b3c303e1c58 100644
--- a/typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
+++ b/typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
@@ -142,7 +142,9 @@ class TemplateAnalyzerModuleFunctionController extends AbstractFunctionModule
             'id' => $this->pObj->id,
             'template' => 'all'
         ];
-        $assigns['moduleLink'] = BackendUtility::getModuleUrl('web_ts', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $assigns['moduleLink'] = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
 
         $assigns['template'] = $template = GeneralUtility::_GET('template');
         $addParams = $template ? '&template=' . $template : '';
diff --git a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
index 3519c66aea98..dc26ebe641d3 100644
--- a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
+++ b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Tstemplate\Controller;
  */
 
 use TYPO3\CMS\Backend\Module\AbstractFunctionModule;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -72,7 +71,9 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
             'createExtension' => 0,
             'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
         ];
-        $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
 
         return [
             'url' => $url,
@@ -132,6 +133,8 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
         if ($existTemplate) {
             $saveId = $this->templateRow['_ORIG_uid'] ? : $this->templateRow['uid'];
         }
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         // Create extension template
         $newId = $this->pObj->createTemplate($this->pObj->id, $saveId);
         if ($newId) {
@@ -140,7 +143,7 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
                 'id' => $this->pObj->id,
                 'SET[templatesOnPage]' => $newId
             ];
-            $url = BackendUtility::getModuleUrl('web_ts', $urlParameters);
+            $url = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
             HttpUtility::redirect($url);
         }
         $tce = null;
@@ -176,7 +179,7 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
                 'createExtension' => 0,
                 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
             ];
-            $assigns['editAllUrl'] = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+            $assigns['editAllUrl'] = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
 
             // Rendering of the output via fluid
             $view = GeneralUtility::makeInstance(StandaloneView::class);
diff --git a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
index d3532ba7b161..1e40da1a980e 100644
--- a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
+++ b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
@@ -157,13 +157,14 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
         $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
         $this->access = is_array($this->pageinfo);
         $view = $this->getFluidTemplateObject('tstemplate');
-
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         if ($this->id && $this->access) {
             $urlParameters = [
                 'id' => $this->id,
                 'template' => 'all'
             ];
-            $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
+            $aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
 
             // JavaScript
             $this->moduleTemplate->addJavaScriptCode(
@@ -243,11 +244,13 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
     {
         $menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
         $menu->setIdentifier('WebFuncJumpMenu');
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($this->MOD_MENU['function'] as $controller => $title) {
             $item = $menu
                 ->makeMenuItem()
                 ->setHref(
-                    BackendUtility::getModuleUrl(
+                    (string)$uriBuilder->buildUriFromRoute(
                         $this->moduleName,
                         [
                             'id' => $this->id,
@@ -318,9 +321,10 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
                     'template' => 'all',
                     'createExtension' => 'new'
                 ];
-
+                /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
                 $newButton = $buttonBar->makeLinkButton()
-                    ->setHref(BackendUtility::getModuleUrl('web_ts', $urlParameters))
+                    ->setHref((string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters))
                     ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:db_new.php.pagetitle'))
                     ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
                         'actions-add',
@@ -347,8 +351,10 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
                     $urlParameters = [
                         'id' => $this->id
                     ];
+                    /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+                    $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
                     $backButton = $buttonBar->makeLinkButton()
-                        ->setHref(BackendUtility::getModuleUrl('web_ts', $urlParameters))
+                        ->setHref((string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters))
                         ->setClasses('typo3-goBack')
                         ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.goBack'))
                         ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
@@ -379,7 +385,9 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
         $urlParameters = [
             'id' => $this->id
         ];
-        $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        $aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
         if ($onlyKey) {
             $title = '<a href="' . htmlspecialchars(($aHref . '&e[' . $onlyKey . ']=1&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateInformationModuleFunctionController')) . '">' . htmlspecialchars($title) . '</a>';
         } else {
@@ -430,7 +438,9 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
             $urlParameters = [
                 'id' => $previousPage['uid']
             ];
-            $previousPage['aHref'] = BackendUtility::getModuleUrl('web_ts', $urlParameters);
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $previousPage['aHref'] = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
             $moduleContent['previousPage'] = $previousPage;
         }
         $view = $this->getFluidTemplateObject('tstemplate', 'NoTemplate');
diff --git a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php
index 52684c4313c8..7db4bdbc0e5d 100644
--- a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php
+++ b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php
@@ -275,8 +275,10 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu
             $urlParameters = [
                 'id' => $this->pObj->id
             ];
-            $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
-            $assigns['moduleUrl'] = BackendUtility::getModuleUrl('web_ts', $urlParameters);
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
+            $assigns['moduleUrl'] = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
             $assigns['isNotInTopLevelKeyList'] = !isset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$this->pObj->sObj]);
             $assigns['hasProperties'] = !empty($theSetup);
             if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$this->pObj->sObj]) {
@@ -326,7 +328,9 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu
             $urlParameters = [
                 'id' => $this->pObj->id
             ];
-            $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+            $aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
             // Parser Errors:
             $pEkey = $bType === 'setup' ? 'config' : 'constants';
             $assigns['hasParseErrors'] = !empty($this->templateService->parserErrors[$pEkey]);
diff --git a/typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php b/typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php
index 004db7bd3e5f..c11348ad91eb 100644
--- a/typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php
+++ b/typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php
@@ -64,8 +64,10 @@ class ViewModuleController extends ActionController
             $languageMenu = $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
             $languageMenu->setIdentifier('_langSelector');
             $languageUid = $this->getCurrentLanguage();
+            /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+            $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
             foreach ($languages as $value => $label) {
-                $href = BackendUtility::getModuleUrl(
+                $href = (string)$uriBuilder->buildUriFromRoute(
                     'web_ViewpageView',
                     [
                         'id' => (int)GeneralUtility::_GP('id'),
diff --git a/typo3/sysext/workspaces/Classes/Backend/ToolbarItems/WorkspaceSelectorToolbarItem.php b/typo3/sysext/workspaces/Classes/Backend/ToolbarItems/WorkspaceSelectorToolbarItem.php
index a8ab6ebdedc5..a688f45d4c4a 100644
--- a/typo3/sysext/workspaces/Classes/Backend/ToolbarItems/WorkspaceSelectorToolbarItem.php
+++ b/typo3/sysext/workspaces/Classes/Backend/ToolbarItems/WorkspaceSelectorToolbarItem.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Workspaces\Backend\ToolbarItems;
  */
 
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
@@ -79,12 +78,14 @@ class WorkspaceSelectorToolbarItem implements ToolbarItemInterface
         $backendUser = $this->getBackendUser();
         $view = $this->getFluidTemplateObject('DropDown.html');
         $activeWorkspace = (int)$backendUser->workspace;
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         foreach ($this->availableWorkspaces as $workspaceId => $label) {
             $workspaceId = (int)$workspaceId;
             $item = [
                 'isActive'    => $workspaceId === $activeWorkspace,
                 'label'       => $label,
-                'link'        => BackendUtility::getModuleUrl('main', ['changeWorkspace' => $workspaceId]),
+                'link'        => (string)$uriBuilder->buildUriFromRoute('main', ['changeWorkspace' => $workspaceId]),
                 'workspaceId' => $workspaceId
             ];
             if ($topItem === null) {
diff --git a/typo3/sysext/workspaces/Classes/Controller/PreviewController.php b/typo3/sysext/workspaces/Classes/Controller/PreviewController.php
index 29b7659f22ad..14af07d781bf 100644
--- a/typo3/sysext/workspaces/Classes/Controller/PreviewController.php
+++ b/typo3/sysext/workspaces/Classes/Controller/PreviewController.php
@@ -61,12 +61,14 @@ class PreviewController extends AbstractController
     protected function initializeAction()
     {
         parent::initializeAction();
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         $this->stageService = GeneralUtility::makeInstance(StagesService::class);
         $this->workspaceService = GeneralUtility::makeInstance(WorkspaceService::class);
         $states = $this->getBackendUser()->uc['moduleData']['Workspaces']['States'];
         $this->pageRenderer->addInlineSetting('Workspaces', 'States', $states);
-        $this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', BackendUtility::getModuleUrl('record_edit'));
-        $this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', BackendUtility::getModuleUrl('record_history'));
+        $this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('record_edit'));
+        $this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('record_history'));
         // @todo this part should be done with inlineLocallanglabels
         $this->pageRenderer->addJsInlineCode('workspace-inline-code', $this->generateJavascript());
     }
diff --git a/typo3/sysext/workspaces/Classes/Controller/ReviewController.php b/typo3/sysext/workspaces/Classes/Controller/ReviewController.php
index 6c21f5a0dd2a..17b86cfe17d8 100644
--- a/typo3/sysext/workspaces/Classes/Controller/ReviewController.php
+++ b/typo3/sysext/workspaces/Classes/Controller/ReviewController.php
@@ -98,10 +98,12 @@ class ReviewController extends AbstractController
                 }
             }
         }
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
         $this->pageRenderer->addInlineSetting('Workspaces', 'isLiveWorkspace', (int)$backendUser->workspace === 0);
         $this->pageRenderer->addInlineSetting('Workspaces', 'workspaceTabs', $this->prepareWorkspaceTabs($wsList, $activeWorkspace));
         $this->pageRenderer->addInlineSetting('Workspaces', 'activeWorkspaceId', $activeWorkspace);
-        $this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', BackendUtility::getModuleUrl('record_edit'));
+        $this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('record_edit'));
         $workspaceIsAccessible = !($backendUser->workspace === 0 && !$backendUser->isAdmin());
         $this->view->assignMultiple([
             'showGrid' => $workspaceIsAccessible,
@@ -198,9 +200,12 @@ class ReviewController extends AbstractController
         foreach ($this->getAdditionalResourceService()->getLocalizationResources() as $localizationResource) {
             $this->pageRenderer->addInlineLanguageLabelFile($localizationResource);
         }
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Workspaces/Backend');
-        $this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', BackendUtility::getModuleUrl('record_edit'));
-        $this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', BackendUtility::getModuleUrl('record_history'));
+        $this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('record_edit'));
+        $this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('record_history'));
         $this->pageRenderer->addInlineSetting('Workspaces', 'id', (int)GeneralUtility::_GP('id'));
     }
 
@@ -267,7 +272,9 @@ class ReviewController extends AbstractController
             $this->uriBuilder->reset()->uriFor('fullIndex');
             $parameters = array_merge($parameters, $this->uriBuilder->getArguments());
         }
-        return BackendUtility::getModuleUrl('web_WorkspacesWorkspaces', $parameters);
+        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
+        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+        return (string)$uriBuilder->buildUriFromRoute('web_WorkspacesWorkspaces', $parameters);
     }
 
     /**
-- 
GitLab