#99217Pagetypes not working with trailing Slashes if default PageTypeSuffix is set
Description
I use Pagetypes for Ajax Calls then this example Url work:
dasisteine/url?mitparement=1&type=93939
and that will not work
dasisteine/url/?mitparement=1&type=93939
i debugged thru the code and found that this
https://github.com/TYPO3/typo3/blob/1b0fea17a5591de55e9c49ca3dd563d8cb95c245/typo3/sysext/core/Classes/Routing/Enhancer/PageTypeDecorator.php#L[…]18
will set the Type to 0 because in my site config i have set this:
PageTypeSuffix:
type: PageType
default: /
suffix: /
index: ''
map:
/: 0
But i think that ist wrong. If i have an Parameter set with type i want to use this and not the default…Reviews 3
Related issues 4
- Bug #87104 PageTypeSuffix removes type parameter for non mapped type values
- Feature #89552Redirect URLs with trailing slashes to their canonical non-trailing-slash URL (or the other way around)
- Bug #107283PageTypeDecorator should add default slash suffix for unconfigured type
- Feature #107296PageTypeDecorator: type suffix mapping option limited to root url
History 711
-
Riccardo De Contardi commented and changed category status
NewNeeds Feedback <span data-processor="relativetime" data-value="2025-04-05T10:32:58+00:00" > 04/05/25, 10:32 </span> -
Tim Obert commented <span data-processor="relativetime" data-value="2025-07-23T06:21:13+00:00" > 07/23/25, 06:21 </span>
Riccardo De Contardi wrote in #note-1:
> Could you try with a recent TYPO3 version like 13 or 14.0.0-dev? I think it has been fixed in the meanwhile.
>
> Thank youUnfortunately, it is not solved in my tests. ‘?type=’ is ignored if default: / is set. The PageType is then always 0.
-
Ayke Halder commented <span data-processor="relativetime" data-value="2025-08-14T09:58:16+00:00" > 08/14/25, 09:58 </span>
I think about different configuration variations:
No default trailing slash
PageTypeSuffix: type: PageType default: '' index: '' map: 'sitemap.xml': 1533906435Result
All of these are already working as expected.
- example.org/someurl —> type=0
- example.org/someurl/ —> type=0
- example.org/someurl/sitemap.xml —> type=1533906435
- example.org/someurl?type=1533906435 —> type=1533906435
- example.org/someurl/?type=1533906435 —> type=1533906435
- example.org/someurl?type=13 —> type=13
- example.org/someurl/?type=13 —> type=13
Default trailing slash
PageTypeSuffix: type: PageType default: '/' index: '' map: 'sitemap.xml': 1533906435Result
- example.org/someurl —> type=0
- example.org/someurl/ —> type=0
- example.org/someurl/sitemap.xml —> type=1533906435
- example.org/someurl?type=1533906435 —> type=1533906435
- example.org/someurl/?type=1533906435 —> type=0 (Unexpected result!)
- example.org/someurl?type=13 —> type=13
- example.org/someurl/?type=13 —> type=0 (Unexpected result!)
Result with additional
.htaccessRewriteRuleof non-slash to slash URLs- example.org/someurl —> example.org/someurl/ —> type=0
- example.org/someurl/ —> type=0
- example.org/someurl/sitemap.xml —> type=1533906435
- example.org/someurl?type=1533906435 —> example.org/someurl/?type=1533906435 —> type=0 (Unexpected result!)
- example.org/someurl/?type=1533906435 —> type=0 (Unexpected result!)
- example.org/someurl?type=13 —> example.org/someurl/?type=13 —> type=0 (Unexpected result!)
- example.org/someurl/?type=13 —> type=0 (Unexpected result!)
Default trailing slash – with enforced slash-to-type-0 mapping
This configuration should be used if you can ensure that you have proper type-mappings configured for all and every type in use.
PageTypeSuffix: type: PageType default: '/' index: '' map: '/': 0 'sitemap.xml': 1533906435Result
- example.org/someurl —> type=0
- example.org/someurl/ —> type=0
- example.org/someurl/sitemap.xml —> type=1533906435
- example.org/someurl?type=1533906435 —> type=1533906435 (Biased result – unsure what is expected here: type=1533906435 or type=0)
- example.org/someurl/?type=1533906435 —> type=0 (Expected result: type 0 is enforced for traling slash in configuration)
- example.org/someurl?type=13 —> type=13 (Biased result – unsure what is expected here: type=13 or type=0)
- example.org/someurl/?type=13 —> type=0 (Expected result: type 0 is enforced for traling slash in configuration)
Result with additional
.htaccessRewriteRuleof non-slash to slash URLs- example.org/someurl —> type=0
- example.org/someurl/ —> type=0
- example.org/someurl/sitemap.xml —> type=1533906435
- example.org/someurl?type=1533906435 —> example.org/someurl/?type=1533906435 —> type=0 (Expected result: type 0 is enforced for traling slash in configuration)
- example.org/someurl/?type=1533906435 —> type=0 (Expected result: type 0 is enforced for traling slash in configuration)
- example.org/someurl?type=13 —> example.org/someurl/?type=13 —> type=0 (Expected result: type 0 is enforced for traling slash in configuration)
- example.org/someurl/?type=13 —> type=0 (Expected result: type 0 is enforced for traling slash in configuration)
Appendix:
.htaccessRewriteRuleof non-slash to slash URLs# If the file/symlink/directory does not exist and url has no dot and no trailing slash => Redirect to url with trailing slash. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+/)?[^./]+$ %{REQUEST_URI}/ [QSA,R=301,L]Also see #89552
-
Ayke Halder changed Related to #89552 <span data-processor="relativetime" data-value="2025-08-14T10:01:53+00:00" > 08/14/25, 10:01 </span>
-
Ayke Halder changed Related to #87104 <span data-processor="relativetime" data-value="2025-08-14T10:16:26+00:00" > 08/14/25, 10:16 </span>
-
Ayke Halder changed Related to #107283 <span data-processor="relativetime" data-value="2025-08-14T10:38:33+00:00" > 08/14/25, 10:38 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 90374 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2025-08-14T10:44:46+00:00" > 08/14/25, 10:44 </span> -
Gerrit Code Review pushed patch set 7 for main to change 90374 <span data-processor="relativetime" data-value="2025-08-14T21:05:13+00:00" > 08/14/25, 21:05 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 90374 <span data-processor="relativetime" data-value="2025-08-14T21:06:16+00:00" > 08/14/25, 21:06 </span>
-
Ayke Halder changed Related to #107296 <span data-processor="relativetime" data-value="2025-08-15T13:31:00+00:00" > 08/15/25, 13:31 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 90374 <span data-processor="relativetime" data-value="2026-04-22T06:33:03+00:00" > 04/22/26, 06:33 </span>
Could you try with a recent TYPO3 version like 13 or 14.0.0-dev? I think it has been fixed in the meanwhile.
Thank you