If your Nextcloud instance is installed in a subfolder called nextcloud and you’re running Apache create or edit the .htaccess file within the document root of your Web server and add the following lines
So the difference: nc root folder ≠ document root of your webserver…
I‘m sorry if my original post was too short…because:
Is NOT „the document root of your Web server“.
The root document root of your webserver is probably: /var/www/html
Are you running an apache webserver?
what do you see if you browse to your ip/ or URL without the subfolder (cloud)?
These questions just to be sure, but probably: just put the .htaccess file under /var/www/html/
/media/fc_daten/.htaccess - data root from nextcloud
# Generated by Nextcloud on 2019-11-08 21:21:50
# line below if for Apache 2.4
Require all denied
# line below if for Apache 2.2
<ifModule !mod_authz_core.c>
deny from all
Satisfy All
</ifModule>
# section for Apache 2.2 and 2.4
<ifModule mod_autoindex.c>
IndexIgnore *
</ifModule>
But still the warnings:
There are some warnings regarding your setup.
* Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the [documentation](https://docs.nextcloud.com/server/16/go.php?to=admin-setup-well-known-URL).
* Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the [documentation](https://docs.nextcloud.com/server/16/go.php?to=admin-setup-well-known-URL)
So the first one (/var/www/html/.htaccess) seams to be fine.
( What does those rewriterules do? They point devices that search the webserver (root of the webserver, the URL without subfolder) for well known services like cal- and carddav to the right place. )
Second /var/www/html/cloud/.htaccess :
I would delete the 5 lines that start with RewriteRule that are already in the one above.
The third one should be fine.
I don‘t know if a server restart is necessary - I would do it anyway sudo systemctl restart apache2
you can test it with wget <ip-address>/.well-known/caldav and see some redirections. “Outside” could even be a ubuntu terminal/shell. But I don’t think the test is wrong.
That one is a tricky one… As it sure is not certain, that you need the function those rewrite-rules give to you… You don’t have problems on “the system” but with probably attached computers/mob-phones… that would be: problems setting up calendar and contact apps. (So: problems elsewhere and the fix on “the system”)
When you put configuration directives in a .htaccess file, and you don’t get the desired effect, there are a number of things that may be going wrong.
Most commonly, the problem is that AllowOverride is not set such that your configuration directives are being honored. Make sure that you don’t have a AllowOverride None in effect for the file scope in question. A good test for this is to put garbage in your .htaccess file and reload the page. If a server error is not generated, then you almost certainly have AllowOverride None in effect.
I like that test! tried with coffee leftover, banana peel etc. - didn’t work
That sentence: " Make sure that you don’t have a AllowOverride None in effect" … That is not trivial: you have to look at least in /etc/apache2/apache2.conf and all the files in or under /etc/apache2/sites-enabled/
Another edit: The documentation says
there are a number of things that may be going wrong
Well that is so reassuring. So there are after a certain time some questions:
is the sun shining? And should I go out for a walk?
do I need this subfolder? That is: will I run anything else than nextcloud on this webserver? Perhaps I could go then with the answer of @magber68 (if I understood that correctly) → the problem then would be different then: how to change the “document root” in the apache configs - or how to setup a good vhost-file for apache. But I think this is much better documented in nextcloud docs then the few words for troubleshooting this redirect issue.
do I want to learn more about this patchy webserver? Solve false problems and learn something rather than avoid problems and learn little