Locally i'm running Valet which works fine. But on the public server all the pages except the homepage return a 404 on the site.com/{locale}/{page}.

I tested it on a server with NGINX and a server with Apache, both don't work.

I created subfolders based on the language ( /nl, /de, /es ) copied the index.php and the .htaccess, modified in each index.php the locale $locale = 'es'; and the site root $site_root = '/es/';

this is my system.yaml

locales:
  en:
    name: Engels
    full: en_US
    url: /
  nl:
    full: nl_NL
    name: Nederlands
    url: /nl/
  de:
    full: de_DE
    name: Duits
    url: /de/
  it:
    full: it_IT
    name: Italiaans
    url: /it/
  es:
    full: es_ES
    name: Spaans
    url: /es/