Project

General

Profile

Actions

Bug #86055

closed

pages.slug always removes the trailing slash

Added by Benni Mack over 5 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2018-08-31
Due date:
% Done:

0%

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

Related issues 3 (1 open2 closed)

Related to TYPO3 Core - Bug #89091: Page with a slug with trailing slash results in 404ClosedStefan Bürk2019-09-05

Actions
Related to TYPO3 Core - Bug #100990: Pages with trailing slash in slug are not resolved if requested uri does not contain a trailing slashResolvedStefan Bürk2023-06-10

Actions
Related to TYPO3 Core - Bug #96599: Slugs with and without trailing slash are considered different but will confuse URL handling in frontendNeeds FeedbackStefan Bürk2022-01-20

Actions
Actions #1

Updated by Gerrit Code Review over 5 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/58099

Actions #2

Updated by Benni Mack over 5 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions #4

Updated by Claus Harup over 5 years ago

"It is totally legitimate to allow /my-page/ as slug (when in FormEngine just remove the "readonly" attribute of the slug field), if explicitly wanted."

That's fine, but whenever I manually end my slug with a trailing / I get a 404 response in FE....

Removing the trailing / again it works like a charm.....

Im working on 9.5.1 and have done no manipulation what so ever regarding slug..... - can you point me in the rigt direction?

Greetings

Actions #5

Updated by Peter Linzenkirchner over 5 years ago

Same in TYPO3 9.5.3: Slug with trailing slash (/myslug/) results in 404.

Actions #6

Updated by Claus Harup over 5 years ago

I have the same excact problem: ending slash results in 404 in TYPO3 v. 9.5.3....

Does anyone have any clue how to fix this.... - Due thousands of indexed URLs endning with slash I have to hold my TYPO3 v. 8 sites from being upgraded :-(

Actions #7

Updated by Josef Glatz over 5 years ago

Hey Peter, hey Claus,

I upgraded my 7.6 instance to 8.6 and then to 9.5. I didn't configured anything special:
  • I took care of filled realurl tables for all pages and extensions.
  • I added the new .htaccess (typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess)
  • I use no sys_domain records
  • I removed all language relevant configuration within TypoScript
  • I fully use the site management configuration for the concerned website pagetree
After the upgrade:
  • all pages are linked without trailing slash
  • Opening a subpage with trailing slash results in a an expected 200 response with the proper webpage
  • I also loaded ext:seo which leads into a correct canonical html tag (the actual page without trailing slash)
  • edit: I think that's not necessary, but I configured the 404 via site configuration too by using a simple pageID

Maybe you can describe us your approach to the upgraded version

Actions #8

Updated by Davide Litrico over 4 years ago

Hello,
I have the same problem with typo3 v 9.5.8, and I find out that despite the fact that the user can save the slug of a page with a trailing slash, during the process of the request in the method matchRequest of the class TYPO3\CMS\Core\Routing\PageRouter the trailing slash is removed.
At the row 132, you can find:

$prefixedUrlPath = '/' . trim($urlPath, '/');

If you substitute trim with ltrim the page will be found, while if you try to reach the page through the url without slash, it will continue to return the 404 page.

However, I don't know if this change could affect typo3 core in other ways, so I preferred not to apply this change.

Actions #9

Updated by Sybille Peters over 3 years ago

  • Related to Bug #89091: Page with a slug with trailing slash results in 404 added
Actions #10

Updated by Marc Hirdes 11 months ago

  • Target version deleted (9.4)
  • % Done changed from 100 to 0
  • TYPO3 Version changed from 9 to 12

Seems like the error is back again in v12.4.1. If the user enters a slug with a trailing slash, then TYPO3 ends in a 404.

Actions #11

Updated by Stefan Bürk 11 months ago

Marc Hirdes wrote in #note-10:

Seems like the error is back again in v12.4.1. If the user enters a slug with a trailing slash, then TYPO3 ends in a 404.

@Marc Hirdes

Not really sure if I got it correct, maybe you could provide some more information. For example:
  • page slug in the database
  • used request uri
  • default language / language -> siteConfig/siteLanguage base configurtion
  • siteConfig routeEnhancers ( for example PageTypeSuffix etc)

You could additionally check if you have some kind of 3rd party extensions
installed providing a middleware interfering here. Also check if there are
some auto-created redirects left in `ext:redirects` redirecting to a invalid
page.

I tried some time arround:

Not working example

page["slug"]......: /my-page/features/
request...........: /my-page/features

is not resolved. The expectation is, that this page is
resolved correctly.

Working examples

page["slug"]......: /my-page/features/
request...........: /my-page/features/
page["slug"]......: /my-page/features
request...........: /my-page/features/
page["slug"]......: /my-page/features
request...........: /my-page/features

If the "not working example" the case you tried to mention ? If yes,
I've created a dedicated issue for this case, see #100990.

If your case is another, please describe your exact use-case with
further information mentioned above. At best in a dedicated/new issue
relating to this or the other issues.

I could confirm the not working case already in 11.5.x.


Related: #100990
Related: #96010
Related: #88715
Related: #89091
Related: #86055

Actions #12

Updated by Stefan Bürk 11 months ago

  • Related to Bug #100990: Pages with trailing slash in slug are not resolved if requested uri does not contain a trailing slash added
Actions #13

Updated by Stefan Bürk 10 months ago

  • Related to Bug #96599: Slugs with and without trailing slash are considered different but will confuse URL handling in frontend added
Actions

Also available in: Atom PDF