Cannot find .htaccess or user.ini

Today I downloaded (v28.0.1.1) from nextcloud and got it up and running. But for the life of me, I cannot find a single .htaccess or .user.ini in the whole zip file.

I have searched support, but I have not found where these files are supposed to be or where to get them from.

I have looked in Git and found them in the root, config, build, apps, tests. Which ones are needed, and where should they be put?

I just want to get rid of the error.


I have determined that there are generated .htaccess files in the following folders.

Apache is the owner and the permissions are set to 775. But I still get this error:

I suspect some of my other errors might be htaccess related. Not sure what to do about it.

I created both files in the html root. Now it stops complaining that they don’t exist. Just that the hashes don’t match. Which means I start ignoring that warning/error. And will potentially miss errors that are important.

I think that this is a classic case of warning overload which causes warnings to be overlooked.


max_execution_time = 3600
max_input_time = 3600
memory_limit = 2G
file_uploads = On
upload_max_filesize = 16G
max_file_uploads = 20


<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule ^\.well-known/carddav /remote.php/dav [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav [R=301,L]
  RewriteRule ^\.well-known/webfinger /index.php/.well-known/webfinger [R=301,L]
  RewriteRule ^\.well-known/nodeinfo /index.php/.well-known/nodeinfo [R=301,L]
  RewriteRule ^ocm-provider/?$ index.php [QSA,L]

Except that your replacements are not complete. The hashing not matching is an additional hint that you’ve still not fixed things.

Those files are managed by Nextcloud Server during installations and updates.

Let’s figure out why the files are missing to start with in your environment.

From the looks of your folder paths you may have crossed some of your folder paths somehow. Maybe you moved some things manually?

The has a weird structure. You have two data folders, example.


The html/data folder has been deleted. And is no longer relevant. It was never used.


If the file has the wrong contents, what should it have?


  1. open a terminal

  2. enter this code (check NC_DIR and HT_USER carefully beforehand):

HT_USER=www-data # change this if your ht user is different
nc_download_default() { local app_id=$1 file=$2 version_tag path=$2
    case "$app_id" in
        server) version_tag="v$(awk -F\' '/String/{gsub(/ /,"");$2=tolower($2);print $2}' "$NC_DIR/version.php")"   ;;
        *)      xml_f="$NC_DIR/apps/$app_id/appinfo/info.xml"
                version_tag="v$(xmlstarlet sel -B -t -v "//info/version" "$xml_f"|sed '2,$d')"
    sudo -u $HT_USER curl -so $NC_DIR/$path$app_id/$version_tag/$file

for missing_file in '.htaccess' '.user.ini'; do nc_download_default server "$missing_file"; done
sudo -u $HT_USER php $NC_DIR/occ integrity:check-core

Then you will have the correct files for your version on the right place.

You can use this function always for missing files (eg. adding it in your ~/.bash_aliases) but if you want to use it for apps (not the server core), you need xmlstarlet

Much and good luck,

Thank you, that solved my problem

I give up.

I reinstalled nextcloud from scratch. Had the same issue with the files missing.
Ran the script and it isn’t working.

Sorry, an SELinux issue


Where did you download that zip file, how did you unpack that zip file?

I checked the zip file and it contains both, .htaccess and .user.ini files. Check yourself, I added a pattern to a file “nextcloud/.not.available” as well, so you can see, it realy shows only files that are present:; curl -o "/tmp/$file" "$file" && unzip -l "/tmp/$file" | grep -E 'nextcloud/(\.htaccess|\.user\.ini|\.not\.available)'; rm "/tmp/$file"

Could you please explain what you did exactly and how you did it?

OK, that was about the script but the other question remains, where did you “loose” the hidden files? :thinking:


I believe it is the same reason.

SELinux prevented them from being written.

It would have been better if the issue was logged or if the installation failed. But it was completed as if everything was working fine.

Thanks again for your help.


This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.