Search code examples
typo3-9.xsymfony-routing

TYPO3 9 routing - .html


Is there a possibility to configure routing in TYPO3 v9 to have .html applied to every URL? In ext:realurl and TYPO3 v8 (and previous versions) configuration defaultToHTMLsuffixOnPrev could have been used.


Solution

  • Yes, TYPO3 v9 supports "page decorators" that need to be configured individually in corresponding site configuration (either in config/sites/ or typo3conf/sites/).

    routeEnhancers:
       PageTypeSuffix:
          type: PageType
          default: '.html'
          index: 'index'
          map:
             '.json': 10
    

    The example above is mapping (default) &type=0 to .html suffix and &type=10 to .json suffix - similar to RealURL's fileName property.

    References