How to patch your htaccess file correctly in composer.json
In the scripts section of your composer.json file, use the following:

"post-drupal-scaffold-cmd": [
  "patch -p0 &lt; patches/htaccess.patch"
]


(this requires "drupal-composer/drupal-scaffold" in your require section)