These are generally caused by downloading the Nextcloud .zip, unzipping it and then copying the files to where you need them… but missing the hidden files (such as .htaccess).
There is more than one way around this, but the easiest way (arguably) is just to move the whole directory after unzipping, instead of the files inside the directory, eg:
mv ./nextcloud /path/to/nextcloud/folder/to/be/folder-name
cp ./nextcloud/* /path/to/nextcloud/folder/to/be/folder-name/
Note: As in this example, mv can change the name of the folder, merely by giving the destination folder a different name. You can see this in the example above where it changes the name of the folder from nextcloud to folder-name. So if you need Nextcloud’s folder to be called http or public_html or similar, just replace folder-name in the example with whatever it needs to be (and remember to copy the owner and permissions)