I've taken over on a project developed by another supplier and now tasked with resolving the issues. I don't know if this is a Drupal, PHP or Apache problem, but here goes.
It's a Drupal 8 multisite with 3 databases. There's a main site and two country sites.
It's installed in the webfolder (/) and contains a regular Drupal 8 setup. It also has two symbolic links (/nl and /de) that point to the same folder. The domains and sites are defined in sites.php.
The current issue is that a part of the path is repeated in the URL e.g. /nl/nl/nl/over-ons and I can't figure out why. It's a link placed in a menu. It makes no difference if the link is defined as a path or route.
It only does this for anonymous traffic (authenticated shows the right link) and it doesn't do this consistently. Sometimes the link is as it should be, other times it added the prefixes. Sometimes there are three prefixes, other times 4, 5 or 7 or whatever. To make it worse: I can't reproduce it locally.
Production environment is Apache/PHP 7.2.20 (Apache 2.0 Handler) Local environment is a Docker setup with PHP as FastCGI plugin.
Any pointers on what the cause is or how to debug?