Loading...


Related Products


Date Published: February 5, 2025

Prevent your .htaccess from being overwritten during Drupal core updates.

Issue

My .htaccess file and other core files are being overwritten during Drupal core updates.

Resolution

To prevent the .htaccess file from being overwritten when Drupal core is updated, you can add the following to the extra section in your composer.json:

- If you are using drupal/core-composer-scaffold add the following:

"extra": {
    "drupal-scaffold": {
      "file-mapping": {
        "docroot/.htaccess": false
      }
    }
  }

- If you are using drupal-composer/drupal-scaffold add the following:

"extra": {
    "drupal-scaffold": {
      "excludes": [
        ".htaccess",
        "robots.txt"
      ]
    }
  }

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation
Back to Site navigation