diff --git a/core/lib/Drupal/Core/PathProcessor/PathProcessorFront.php b/core/lib/Drupal/Core/PathProcessor/PathProcessorFront.php
index 8045dd371b..d5c1faf24d 100644
--- a/core/lib/Drupal/Core/PathProcessor/PathProcessorFront.php
+++ b/core/lib/Drupal/Core/PathProcessor/PathProcessorFront.php
@@ -60,6 +60,25 @@ public function processInbound($path, Request $request) {
    * {@inheritdoc}
    */
   public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
+    // Get the path or alias for the front page.
+    if (\Drupal::moduleHandler()->moduleExists('path_alias')) {
+      $front = $this->config->get('system.site')->get('page.front');
+      $langcode = !empty($options['language']) ? $options['language']->getId() : NULL;
+
+      // Get path and alias for the configured frontpage setting
+      $alias_manager = \Drupal::service('path_alias.manager');
+      $front_path = $alias_manager->getPathByAlias($front, $langcode);
+      $front_alias = $alias_manager->getAliasByPath($front, $langcode);
+
+      // Replace the path and alias with default frontpage path
+      if (!empty($front_path) && $path === $front_path) {
+        $path = '/';
+      }
+      if (!empty($front_alias) && $path === $front_alias) {
+        $path = '/';
+      }
+    }
+
     // The special path '<front>' links to the default front page.
     if ($path === '/<front>') {
       $path = '/';
