Can the installation directory be change (not only the data folder)

I’ve search a lot but always end up with the “change data folder place” subject. In my case it’s my main directory I want to change… if possible.
Let me try to explain. FYI, I’m far to be an expert in this stuff.
I have a home server setup with Ubuntu 22.04.4 LTS. I’ve managed to install Nextcloud on it and it works fine. At first I wanted to dedicate this server to nextcloud, but now I would like to setup a wordpress to, but I’ve setup NC directly in “/www/nextcloud”, and now my NC access is directly at the root of my local IP or my dynamic DNS name. Ex: https://myserver.ddns.net
Now I can’t setup anything like “https://myserver.ddns.net/wordpress” because it shows as a missing NC page.
What can I do with my actual Nextcloud installation to access it at “https://myserver.ddns.net/nextcloud”?

On my test server i use SQLite. For tests i copy the full directory and only change the settings in config.php. Works for me.

Must be something more with my setup, because changing the path in config.php doesn’t work for me.
Perhaps with Apache2?

Yes you must change or add apache2 conf if you do not use subdirectory.