Typo3 9 - readable URL suffix

The config.yaml of the Typo3 page can be used to add the suffix '.html' to the slug.

Typo3 9.5.0 LTS introduces many new features. One of them is that readable URLs are now a core feature.

Many Typo3 installations were previously operated with RealURL. With RealURL many pages were configured to append the suffix '.html'.
If you want the readable URLs to be callable with this extension after an upgrade to Typo3 9.5.0 LTS, you have to define a PageType suffix in the page configuration.

First the site configuration has to be crated:

  • Site management -> Sites
  • Add new site configuration for this site
  • Configure and save accordingly
  • We now need the "Site Identifier" to edit the configuration file:
  • typo3conf/sites/[Site Identifier]/config.yaml

Add the following at the end of config.yaml:

 

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default: '.html'
    map:
      '.html': 0

 

The 0 in the last line is the typeNum.

 

Please note, however, that this is actually intended to request a certain PageType via the suffix.

Thus the standard PageType is always returned by calling the URL without suffix. In our case both URLs work without a redirect:

www.example.com/home


www.example.com/home.html

In order to avoid duplicate content it is therefore essential to set the Canonical tag with this solution!

Quelle: docs.typo3.org/typo3cms/extensions/core/Changelog/9.5/Feature-86160-PageTypeEnhancerForMappingTypeParameter.html

Oops, an error occurred! Code: 20200921224257827a0e5b