Project

General

Profile

Actions

Bug #88633

closed

Slugs ending with substring "index" result in an 404 error

Added by Jan Loderhose almost 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-06-26
Due date:
% Done:

100%

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

Description

Example to reproduce:

1. Create a page called "stock index" resulting in the slug "stock-index".
2. Type [your domain][path to]/stock-index.html in the address bar and hit enter.
3. Observe how TYPO3 presents you with an 404 error.
4. Remove ".html" from the URL and hit enter again.
5. Get the requested page delivered as expected in step 2.

The behavior can be reproduced with any URL ending with "[some nonempty string]index.html".

Here's the route enhancer of the corresponding sites config.

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default: .html
    map:
      .html: 0
      solr-autocomplete.json: 7384
      sitemap.xml: 1533906435

I suspect that the TYPO3 core calculates false parameters due to some general behavior if a URL ends with "index.html".


Related issues 1 (0 open1 closed)

Precedes TYPO3 Core - Bug #91245: foo/index.html leads to 404 since TYPO3 9.5.16Closed2019-06-272019-06-27

Actions
Actions #1

Updated by Jan Loderhose almost 5 years ago

  • Description updated (diff)
Actions #2

Updated by Harald Glaser over 4 years ago

I ran into this issue too and found the source of this behavior in \TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator:
if not given in the configuration, a property "index" is set to "index".
And this value is then - seemingly somehow incorrectly - used in the regex when resolving an URL, resulting in every URL ending with this value to fail.

I'm not fully comprehending what's happening with these regexes, so I'm not able to provide a patch.
My dirty workaround for now: I have added the property "index" to my Enhancer-Config and set it to a random string, so it never matches...

Actions #3

Updated by Anonymous over 4 years ago

Harald Glaser wrote:

I ran into this issue too and found the source of this behavior in \TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator:
if not given in the configuration, a property "index" is set to "index".
And this value is then - seemingly somehow incorrectly - used in the regex when resolving an URL, resulting in every URL ending with this value to fail.

I'm not fully comprehending what's happening with these regexes, so I'm not able to provide a patch.
My dirty workaround for now: I have added the property "index" to my Enhancer-Config and set it to a random string, so it never matches...

Seems like I can provide a fix for this. Going to submit a PR.

Actions #4

Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61965

Actions #5

Updated by Gerrit Code Review over 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61965

Actions #6

Updated by Gerrit Code Review over 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61965

Actions #7

Updated by Guido Schmechel about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions #9

Updated by Gerrit Code Review almost 4 years ago

  • Status changed from Closed to Under Review

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64273

Actions #10

Updated by Gerrit Code Review almost 4 years ago

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64273

Actions #11

Updated by Guido Schmechel almost 4 years ago

  • Status changed from Under Review to Resolved
Actions #12

Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed
Actions #13

Updated by Stephan Großberndt almost 4 years ago

  • Precedes Bug #91246: routeEnhancer defaults not applied in TYPO3 v9.5.16 added
Actions #14

Updated by Stephan Großberndt almost 4 years ago

  • Precedes Bug #91245: foo/index.html leads to 404 since TYPO3 9.5.16 added
Actions #15

Updated by Oliver Hader almost 4 years ago

  • Precedes deleted (Bug #91246: routeEnhancer defaults not applied in TYPO3 v9.5.16)
Actions

Also available in: Atom PDF