Running two installations on same domain: example.tld and example.tld/subfolder

Hello, I was wondering if there is a simple way to run two separate installations on a main TLD and also on a folder of the same TLD? I guess the first problem is that I have to configure the “main” installation to not serve a 404 page if I try to access the subfolder. Is there any way to do this easily? Thanks!

I have such a setup running on Uberspace without any issues. But probably depends on the configuration.