documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Clarification for htaccess.RewriteBase: For folders or urls?

Open hwalinga opened this issue 6 months ago • 0 comments

The docs on htaccess.RewriteBase have the following paragraph:

In a standard Apache setup this usually equals the folder that Nextcloud is accessible at. So if Nextcloud is accessible via “https://mycloud.org/nextcloud” the correct value would most likely be “/nextcloud”. If Nextcloud is running under “https://mycloud.org/” then it would be “/”.

Initially, it talks about the folder, then it gives an example about URLs. Usually this is interchangeable, but I am not sure if that is true here.


I had a proxy where domain.com/nextcloud/ is redirected to localhost:8080/ where Nextcloud is hosted. I read the documentation and set htaccess.RewriteBase to /nextcloud, however I was facing infinite redirects when doing so. In the error logs I could see that /nextcloud/config.php was infinitely redirected to /nextcloud/config.php. Then I changed htaccess.RewriteBase to / and everything worked again.

So maybe it is better to put emphasis that Nextcloud really is in a "/nextcloud" folder in your Apache setup. Not that it is accessible under the URL "/nextcloud". (Which can be redirected eventually.)

hwalinga avatar Jul 17 '25 16:07 hwalinga