I am using composer with Drupal lightning. If I update Drupal via composer, it updates the .htaccess file.
Is there any way to prevent the .htaccess file from being overwritten?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
While the accepted answer is correct and this prevent the .htacces file from being overwritten, most updates done to that files are linked to security issues. You should patch the file instead, as described in this answer : https://drupal.stackexchange.com/a/271147/25673
Here's a copy of the answer by Stef Van Looveren
scriptssection of your composer.json file, use the following:
"post-drupal-scaffold-cmd": [ "patch -p0 < patches/htaccess.patch" ]
(this requires "drupal-composer/drupal-scaffold" in your