If you have installed the nextcloud package via dnf from the Fedora repos, I would leave the directories as they are unless you know exactly what you are doing and what the possible side effects might be, e.g. when updating Nextcloud via dnf.
Another and probably better option would be not to use the package from the Fedora repos, and instead manually set up a LAMP stack, download the zip or tarball from here, extract it (e.g., to /var/www/html/nextcloud/), and then configure Apache manually.
The following example is based on CentOS 8, so it may not be a perfect match for a current version of Fedora, but it should still give a general idea of how a manual installation might work: Nextcloud installation on CentOS 8.
Thanks BB7 your suggestion worked a treat. It is now also working as http://example.com . which I was trying before and not hhttp://example.com/nextcloud. I have installed certbot bay have not manage to do hpps yet. Ny quick suggestions. as to whee the required config files will be.