# Code integrity .htaccess not passed the integrity check

**URL:** <https://help.nextcloud.com/t/code-integrity-htaccess-not-passed-the-integrity-check/251676>\
**Category:** ℹ️ Support\
**Tags:** nc34, cloudflare\
**Created:** [November 2, 2026, 4:08pm UTC](https://help.nextcloud.com/t/code-integrity-htaccess-not-passed-the-integrity-check/251676 "2026-11-02T16:08:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cirrus](https://help.nextcloud.com/letter_avatar/cirrus/32/6_22734026db12803ebb3e059622ac3534.png) [@Cirrus](https://help.nextcloud.com/u/Cirrus)\
**Post date:** [November 2, 2026, 4:08pm UTC](https://help.nextcloud.com/t/code-integrity-htaccess-not-passed-the-integrity-check/251676/1 "2026-11-02T16:08:32Z")

</div>

> **Support intro**
>
> ## Sorry to hear you’re facing problems. 🙁
> 
> _The community help forum ([help.nextcloud.com](http://help.nextcloud.com)) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are **volunteering their time to help you.** _
> 
> **If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via [portal.nextcloud.com](http://portal.nextcloud.com) where Nextcloud engineers can help ensure your business keeps running smoothly.**
> 
> ## Getting help
> 
> In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.
> 
> **Before clicking submit** : Please check if your query is already addressed via the following resources:
> 
> - [Official documentation](https://docs.nextcloud.com) (searchable and regularly updated)
> - [How to topics and FAQs](https://help.nextcloud.com/c/how-to-faqs/9)
> - [Forum search](https://help.nextcloud.com/search)
> 
> (Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. ❤

## The Basics

- Nextcloud Server version _(e.g., 29.x.x)_:
  - `35.0.2`

- Operating system and version _(e.g., Ubuntu 24.04)_:
  - `Ubuntu 22.04`

- Web server and version _(e.g, Apache 2.4.25)_:
  - `2.4.69`

- Reverse proxy and version \_(e.g. nginx 1.27.2)
  - `n/a`

- PHP version _(e.g, 8.3)_:
  - `8.3.36`

- Is this the first time you’ve seen this error? (Yes / No):
  - `Yes`

- When did this problem seem to first start?
  - `Just before and since upgrading from v 34.0.5 to v 35.0.2`

- Installation method _(e.g. AlO, NCP, Bare Metal/Archive, etc.)_
  - `Bare metal`

- Are you using CloudfIare, mod\_security, or similar? _(Yes / No)_
  - `Cloudflare - Yes`

### Summary of the issue you are facing:

My .htaccess file has failed a “code integrity” check

From my Admin Settings Overview page:

```auto
Code integrity

Some files have not passed the integrity check. List of invalid files… Rescan…

```

And when I hit the “List of invalid files”-option, i get:

```auto
Raw output
==========
Array
(
    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [.htaccess] => Array
                        (
                            [expected] => a2d827c...
                            [current] => 17477516e...
                        )

                )

        )

)

```

### Steps to replicate it (hint: details matter!):

The problem appeared just _before_ I updated NC from v 34.0.5 to 35.0.2 (my current version) and I thought I had successfully dealt with it via the second solution below:

**Solutions attempted** :

1. Tried **ernolf** ’s “nc-integrity-fix”-script, as detailed here:

[https://help.nextcloud.com/t/nc-integrity-fix-script-to-resolve-some-files-have-not-passed-the-integrity-check-warnings/194729](https://help.nextcloud.com/t/nc-integrity-fix-script-to-resolve-some-files-have-not-passed-the-integrity-check-warnings/194729)

Didn’t help:

```auto
azed@azed-byte:~$ nc-integrity-fix
This app is affected:

core
The hash of this file in [core] is invalid:

.htaccess

Q: Do you want to replace this invalid file with a file downloaded from github
for your version?
Make your choice: ([y]es or [n]o) [yes]: y
download of '.htaccess' failed. You must check this one yourself

```

1. Tried to replace my .htaccess-file for an “uncorrupted” one, as detailed here:

[https://help.nextcloud.com/t/code-integrity-check-problems/1895/2](https://help.nextcloud.com/t/code-integrity-check-problems/1895/2)

Downloaded the appropriate (v. 34.0.5) nextcloud files from here:

[https://nextcloud.com/changelog/#latest34](https://nextcloud.com/changelog/#latest34)

-- Extracted the .htaccess file

-- Checked permissions matched:

OLD

`azed@azed-byte:~$ ls -l /var/www/nextcloud/.htaccess`  
`-rw-r--r-- 1 www-data www-data 7940 Oct 17 17:02 /var/www/nextcloud/.htaccess`

NEW

```auto
azed@azed-byte:~$ ls -l /home/azed/Downloads/Nextcloud/nextcloud-34.0.5/.htaccess
-rw-r--r-- 1 azed azed 6677 Oct 15 09:17 /home/azed/Downloads/Nextcloud/nextcloud-34.0.5/.htaccess

```

-- Fixed file ownership:

`sudo chown www-data:www-data /home/azed/Downloads/Nextcloud/nextcloud-34.0.5/.htaccess`

`azed@azed-byte:~$ ls -l /home/azed/Downloads/Nextcloud/nextcloud-34.0.5/.htaccess`  
`-rw-r--r-- 1 www-data www-data 7940 Oct 24 15:44 /home/azed/Downloads/Nextcloud/nextcloud-34.0.5/.htaccess`

-- Replaced the old .htaccess-file with the new

```auto
azed@azed-byte:~$ sudo mv /home/azed/Downloads/Nextcloud/nextcloud-34.0.5/.htaccess /var/www/nextcloud/.htaccess

```

-- Reloaded apache2

`azed@azed-byte:~$ sudo systemctl reload apache2`

When I re-loaded the Administrator Settings Overview page, the code integrity warning had disappeared (hoorah!)

However, after the update to NC v 35.0.2, it re-appeared (boo!)

1. I also tried this suggested fool-the-system work-around:

[https://help.nextcloud.com/t/27-1-1-howto-reset-invalid-hash-on-htaccess-to-eliminate-issue-in-admin-overview/170766](https://help.nextcloud.com/t/27-1-1-howto-reset-invalid-hash-on-htaccess-to-eliminate-issue-in-admin-overview/170766)

see also here:

[https://help.nextcloud.com/t/integrity-check-failed-htaccess-file-invalid/163774/2](https://help.nextcloud.com/t/integrity-check-failed-htaccess-file-invalid/163774/2)

Did as suggested:

-- Edited end of /var/www/nextcloud/config/config.php

From:

`'mail_smtpport' => '465',`  
`'mail_smtpauth' => 1,`  
`'mail_smtpname' => ``'``withheld',`  
`'mail_smtppassword' => 'withheld',`  
`'theme' => '',`  
`'loglevel' => 2,`  
`'htaccess.RewriteBase' => '/',`  
`'serverid' => '0',`  
`);`

To:

`'mail_smtpport' => '465',`  
`'mail_smtpauth' => 1,`  
`'mail_smtpname' => 'withheld',`  
`'mail_smtppassword' => 'withheld',`  
`'theme' => '',`  
`'loglevel' => 2,`  
`'htaccess.RewriteBase' => '/',`  
`'serverid' => '0',`  
`'integrity.check.disabled' => true,`  
`);`

-- Saved file

-- Re-loaded Admin Settings Overview page - code-integrity error had vanished

-- Removed the line " ‘integrity.check.disabled’ =\> true, " from /var/www/nextcloud/config/config.php

-- Logged out and in again: code integrity problem was back (sigh)

**QUESTIONS:**

1. **Why am I getting this error**
2. **How do I get rid of it (permanently)?**

### Log entries

#### Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the _Copy raw_ option from _Administration settings-\>Logging_ screen or from your `nextcloud.log` located in your data directory). Feel free to use a pastebin/gist service if necessary.

Here are a couple of entries from the Administrator Settings Overview “Logging”-page from the time of my update to v35.0.2. They don’t appear to me to be very useful:

`{"reqId":"wUKyvHlXi3QI9dtIWqOU","level":1,"time":"2026-10-24T14:23:27+00:00","remoteAddr":"192.168.1.237","user":"--","app":"updater","method":"GET","url":"/ocs/v2.php/core/update?requesttoken=YbI9hp8CZHCM4T1rGdgDoxh9N9PqUVUjQO%2FMcgIOb0w%3D%3AEvdL4fBnUgSng2wyd6Fl8ltMTrrTGjpvCt%2BFHHA5IQA%3D","scriptName":"/ocs/v2.php","message":"\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36 OPR/138.0.0.0","version":"34.0.5.1","data":{"app":"updater"},"id":"6ae8a58bc769b"}`

`{"reqId":"wUKyvHlXi3QI9dtIWqOU","level":1,"time":"2026-10-24T14:23:35+00:00","remoteAddr":"192.168.1.237","user":"--","app":"updater","method":"GET","url":"/ocs/v2.php/core/update?requesttoken=YbI9hp8CZHCM4T1rGdgDoxh9N9PqUVUjQO%2FMcgIOb0w%3D%3AEvdL4fBnUgSng2wyd6Fl8ltMTrrTGjpvCt%2BFHHA5IQA%3D","scriptName":"/ocs/v2.php","message":"\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36 OPR/138.0.0.0","version":"34.0.5.1","data":{"app":"updater"},"id":"6ae8a58bc7696"}`

#### Web Browser

If the problem is related to the Web interface, open your browser inspector _Console_ and _Network_ tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

N/A

#### Web server / Reverse Proxy

The output of your Apache/nginx/system log in `/var/log/ ____ `:

Couldn’t see anything relevant

### Configuration

#### Nextcloud

The output of `occ config:list system` or similar is best, but, if not possible, the contents of your `config.php` file from `/path/to/nextcloud` is fine (make sure to remove any identifiable information!):

Can be provided if you think it would help

#### Apps

Again, list of apps can be provided if you think it would help

### Tips for increasing the likelihood of a response

- Use the `preformatted text` formatting option in the editor for all log entries and configuration output.
- If screenshots are useful, feel free to include them.
  - If possible, also include key error output in text form so it can be searched for.

- Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/6_22734026db12803ebb3e059622ac3534.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [November 2, 2026, 7:41pm UTC](https://help.nextcloud.com/t/code-integrity-htaccess-not-passed-the-integrity-check/251676/2 "2026-11-02T19:41:36Z")

</div>

> [@Cirrus](#):
>
> However, after the update to NC v 35.0.2, it re-appeared (boo!)

How, precisely, are you updating?
