Managing Multilingual TYPO3 Sites with Site Handling YAML
Move routing, languages, and error handling out of .htaccess and into version-controlled TYPO3 Site Handling config.
06 Mar 2026, 09:44 UTC

The problem: rewrite rules are not deployment configuration
You are maintaining a TYPO3 site where the previous team added languages by appending RealURL configuration and editing domain-specific .htaccess rewrite rules. When a new German section goes live, someone must log into the server, edit rewrite rules, reload the web server, and hope the cache is cleared everywhere. The configuration lives outside version control, so staging and production can drift silently.
The useful takeaway: TYPO3 Site Handling, introduced in v9 LTS and continued in current LTS releases, stores root page, base URL, languages, error handling, and route enhancers in config/sites/{siteIdentifier}/config.yaml. Treat that file as code, review it in pull requests, and deploy it with the rest of the project.
What belongs in the site YAML
Assume a Composer-based TYPO3 installation. The site identifier is a directory name under config/sites/, and the YAML file inside it declares how TYPO3 resolves a request to a page and language.
Key sections include:
base: the public base URL for the site.rootPageId: the page ID that serves as the site root.languages: one block per language, withlanguageId,basepath, locale, and fallback behavior.errorHandling: maps HTTP error codes to TYPO3 pages or custom handlers.routes.routeEnhancers: maps Extbase plugin actions to speaking URLs using aspect mappers, reducing custom controller routing.
Worked example: adding German to an English site
This configuration is illustrative; adapt the site identifier, page IDs, and locales to your installation.
# config/sites/myproject/config.yaml
base: 'https://www.example.com/'
rootPageId: 1
languages:
-
title: English
languageId: '0'
base: /
locale: en_US.UTF-8
iso-639-1: en
hreflang: en
direction: ltr
typo3Language: en
fallbackType: fallback
fallbacks: '0'
-
title: Deutsch
languageId: '1'
base: /de/
locale: de_DE.UTF-8
iso-639-1: de
hreflang: de
direction: ltr
typo3Language: de
fallbackType: free
fallbacks: '0'
errorHandling:
-
errorCode: 404
errorHandler: Page
errorContentSource: 't3://page?uid=42'
routes:
routeEnhancers:
NewsPlugin:
type: Extbase
extension: News
plugin: Pi1
routes:
-
routePath: '/news/{news_title}'
_controller: 'News::detail'
_arguments:
news_title: news
aspects:
news_title:
type: PersistedAliasMapper
tableName: tx_news_domain_model_news
routeFieldName: slug
Run the following from the TYPO3 project root—typically the directory containing vendor/ and public/—using a user with write access to config/sites/ and the TYPO3 cache directories:
cd /var/www/typo3
php vendor/bin/typo3 cache:flush
Replace /var/www/typo3 with your actual project path. In some Composer layouts the binary is typo3/sysext/core/bin/typo3. The risk of running this command is low, but flushing the cache temporarily regenerates cached pages and can cause a brief traffic spike on a busy site.
After the flush, open the TYPO3 backend and go to Site Management. The site identifier, base URL, and both language entries should load without configuration errors. Visit https://www.example.com/de/ and confirm the language switcher points to translated pages. Request a page that does not exist and confirm TYPO3 renders the configured 404 page instead of a generic web server error.
Trade-offs and limitations
- Changes to
config.yamldo not take effect until you flush caches. Forgetting this is the most common reason editors believe their edit "did not work." fallbackType: strictcan return 404 for untranslated pages, whilefreemay display fallback-language content under the translated URL. Choose deliberately based on SEO and user-experience requirements.- Do not combine Site Handling base URLs with RealURL or custom
.htaccessrewrites for the same domain. Overlapping rules can cause redirect loops or 404s. - Avoid secrets in this file. Treat it as deployment configuration and restrict file system access according to your hosting layout.
- Behavior can change between TYPO3 major releases. Confirm Site Handling and routing behavior against the current LTS release notes before starting a new project.
Rollback and verification
Because editing config.yaml changes system state, keep the file under version control. If a deployment causes broken URLs or wrong-language content, revert the file to the previous commit, redeploy, and flush caches again.
Use this checklist before and after deployment:
- Diff
config/sites/{siteIdentifier}/config.yamlbetween staging and production to confirm they match. - Open Site Management in the backend and confirm no configuration errors appear.
- Browse each configured language path and confirm translated URLs resolve.
- Request a missing page and confirm the configured error page renders.
Site Handling will not fix poor content translation or replace a multilingual SEO strategy, but it removes server-level rewrite rules from your deployment pipeline and keeps routing visible to the whole team.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.