Bug #88544
openTrailing slash gets added to "homepage" urls if base is without trailing slash
0%
Description
While using language prefixes within the URL like /de, the canonical URL is always ending with a trailing slash (/de/)
TYPO3 version: 9.5.7
Updated by Richard Haeser over 5 years ago
- Status changed from New to Needs Feedback
Atlan,
The canonical link is created like all other links, so I guess all links have a trailing slash in your situation? Can you give me some more background information of your case?
Updated by Kevin Appelt about 5 years ago
- Subject changed from Trailing slash while using canoinical URL to Trailing slash gets added to "homepage" urls if base is without trailing slash
- Category changed from SEO to Site Handling, Site Sets & Routing
- Status changed from Needs Feedback to Accepted
- Priority changed from Should have to Must have
I can confirm the issue.
v9 /en/
<link rel="canonical" href="https://typo3-9.ddev.site/en/"/>
v9 /en
<link rel="canonical" href="https://typo3-9.ddev.site/en/"/> => which resolves to a 307 to https://typo3-9.ddev.site/en
v10 (current master) /en/
<link rel="canonical" href="https://typo3-master.ddev.site/en/"/>
v10 (current master) /en
<link rel="canonical" href="https://typo3-master.ddev.site/en/"/> => which resolves to a 307 to https://typo3-master.ddev.site/en
Especially for the canonicals this 307 redirect is very unfortunate.
Conclusion- This problem is within the url generation of TYPO3 and not only related to the canonical.
- This problem is not related to a special TYPO3 or PHP Version.
- This problem is only related to the "homepage" of a site, but not to subpages.
Suggestions
https://example.org/ <— (root resource, ending with slash)
https://example.org/en/whatever <— correct
https://example.org/en/whatever/ <— not correct
Domain | Site Language Base | Slug
https://example.org | /en | / —> https://example.org/en
https://example.org | /en/ | / —> https://example.org/en
https://example.org | / | / —> https://example.org/
https://example.org | /en | /subpage —> https://example.org/en/subpage
https://example.org | /en/ | /subpage —> https://example.org/en/subpage
https://example.org | / | /subpage —> https://example.org/subpage
https://example.org | /en | /subpage/ —> https://example.org/en/subpage
https://example.org | /en/ | /subpage/ —> https://example.org/en/subpage
https://example.org | / | /subpage/ —> https://example.org/subpage
Enforced Trailing Slash for all urls via custom RouteEnhancer only
Trailing slash without enforcement should redirect via 307 to no trailing slash
Updated by Guido Schmechel almost 5 years ago
- Related to Bug #90045: Sitemap Errors if the language has no trailing slash at the end like /de it is linked in the sitemap like /de/ added
Updated by Timo Poppinga almost 5 years ago
- Related to Bug #90151: ContentObjectRenderer typoLink language link is generated witch / added
Updated by Sybille Peters almost 4 years ago
- Related to Bug #89091: Page with a slug with trailing slash results in 404 added