How to fix "the .htaccess file does not work" message


One of the following message is showing up during setup or within your admin control panel:

[quote]Your data directory and files are probably accessible from the internet because the .htaccess file does not work.
For information how to properly configure your server, please see the documentation.[/quote]

[quote]Ihr Datenverzeichnis und Ihre Dateien sind wahrscheinlich vom Internet aus erreichbar, weil die .htaccess-Datei nicht funktioniert.
Bitte lesen Sie die Dokumentation, um zu erfahren, wie Sie Ihren Server richtig konfigurieren können.[/quote]

A generic solution is to move your data directory out of the web accessible directory like described in the documentation:

If you don’t want to move your data directory first make sure that no:

/var/www/owncloud/data/htaccesstest.txt (replace the path with your current path)

exists which could fail this test.

First make sure that the .htaccess file located at:

/var/www/owncloud/data/.htaccess (or the location where you have installed ownCloud)

exists, is readable by the user running your webserver (mostly www-data) and contains the following:

deny from all
IndexIgnore *

The second step is to configure your webserver to parse .htaccess files. This can be achieved with the config directive “AllowOverride All” in your vhost configuration (If there is already an “AllowOverride None” configured you need to replace it).

On various distros you need to edit the /etc/apache2/apache2.conf directly and replace the “AllowOverride None” with “AllowOverride All”.

After doing this step please make sure that you restart your Webserver!!!

An example of such a vhost configuration is provided in the official documentation located here:

When using NginX you need to make sure that you’re running the config provided at the official documentation:

Especially this part of the config is needed to protect your data directory:

        location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
                deny all;

No idea, infos are welcome.

Newbie error - data directory maybe visible
Security Message