Drupal 9 Patch htaccess with Composer In composer.json add to the scripts section. See below: "scripts": { "pre-install-cmd": [], ... "post-drupal-scaffold-cmd": [ "patch -p1 < patches/my-htaccess.patch" ] }, Tags Composer Configuration Drupal Drupal 8 Drupal 9