Solution that worked for me (main language English + 4 other languages).
- Single
404.htmlinlayouts - Added
config/development/server.tomlfor local redirects - In
server.toml(French as an example):
[[redirects]]
from = '/fr/**'
to = '/fr/404.html'
status = 404
[[redirects]] # Default language should be last.
from = '/**'
to = '/404.html'
status = 404
- For redirects on Netlify, in
netlify.toml(German as an example):
[[redirects]]
from = "/de/*"
to = "/de/404.html"
status = 404