Project

General

Profile

Actions

Bug #90579

open

Redirects module only works on URLs with trailing slashes

Added by Florian Grell about 4 years ago. Updated about 4 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-02-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

As an editor, I want to be create a redirect from "/source-path/" to "/source-path" (remove the trailing slash).
This leads to an infinite redirect loop.

Actions #1

Updated by Markus Klein about 4 years ago

Please post your Site configuration as well.

Actions #2

Updated by Florian Grell about 4 years ago

base: /
baseVariants: {  }
disableStaticFileCache: false
errorHandling:
  -
    errorCode: '404'
    errorHandler: Page
    errorContentSource: 't3://page?uid=50'
languages:
  -
    title: Deutsch
    enabled: true
    languageId: '0'
    base: /
    typo3Language: default
    locale: de_DE
    iso-639-1: de
    navigationTitle: ''
    hreflang: de-DE
    direction: ''
    flag: de
  -
    title: Englisch
    enabled: true
    languageId: '2'
    base: /en/
    typo3Language: default
    locale: en_US
    iso-639-1: en
    navigationTitle: ''
    hreflang: ''
    direction: ''
    fallbackType: strict
    fallbacks: '1'
    flag: en-us-gb
rootPageId: 1
routeEnhancers:
  NewsPlugin:
    type: Extbase
    extension: News
    plugin: Pi1
    routes:
      - routePath: '/'
        _controller: 'News::list'
      -
        routePath: '/{news_title}'
        _controller: 'News::detail'
        _arguments:
          news_title: news
      -
        routePath: '/{page}'
        _controller: 'News::list'
        _arguments:
          page: '@widget_0/currentPage'
    defaultController: 'News::list'
    defaults:
      page: '0'
    requirements:
      page: '\d+'
    aspects:
      page:
        type: StaticRangeMapper
        start: '1'
        end: '100'
      news_title:
        type: PersistedAliasMapper
        tableName: tx_news_domain_model_news
        routeFieldName: path_segment
  CoursePlugin:
    type: Extbase
    limitToPages:
      - 44
    extension: MyExtkey
    plugin: Myplugin
    routes:
      -
        routePath: '/{number}'
        _controller: 'Myplugin::detail'
        _arguments:
          number: number
    aspects:
      number:
        type: MypluginValueMapper
  PageTypeSuffix:
    type: PageType
    map:
      sitemap.xml: 1533906435
routes: {  }

Actions #3

Updated by Florian Grell about 4 years ago

I believe the problematic code is in the RedirectService, Lines 67-69:

if (!empty($allRedirects[$domainName]['flat'][rtrim($path, '/') . '/'])) {
    $possibleRedirects = $allRedirects[$domainName]['flat'][rtrim($path, '/') . '/'];
}

Actions #4

Updated by Benni Mack about 4 years ago

  • Status changed from New to Accepted
Actions

Also available in: Atom PDF