How to patch your htaccess file correctly in composer.json

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
3
down vote

favorite
1












After running composer update my Drupal installation gets updated. But I'm tired of manually editing my .htaccess file each time. How can I correctly patch it?










share|improve this question





























    up vote
    3
    down vote

    favorite
    1












    After running composer update my Drupal installation gets updated. But I'm tired of manually editing my .htaccess file each time. How can I correctly patch it?










    share|improve this question

























      up vote
      3
      down vote

      favorite
      1









      up vote
      3
      down vote

      favorite
      1






      1





      After running composer update my Drupal installation gets updated. But I'm tired of manually editing my .htaccess file each time. How can I correctly patch it?










      share|improve this question















      After running composer update my Drupal installation gets updated. But I'm tired of manually editing my .htaccess file each time. How can I correctly patch it?







      8 composer htaccess






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 24 mins ago









      leymannx

      5,85642356




      5,85642356










      asked 1 hour ago









      Stef

      506411




      506411




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote













          In the scripts section 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 require section)






          share|improve this answer




















          • Using drupal-composer/drupal-project I simply added one function to its ScriptHandler.php that always symlinks me my own .htaccess from the composer root dir as post-install-cmd and post-update-cmd into the web root dir.
            – leymannx
            1 hour ago










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "220"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdrupal.stackexchange.com%2fquestions%2f271146%2fhow-to-patch-your-htaccess-file-correctly-in-composer-json%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote













          In the scripts section 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 require section)






          share|improve this answer




















          • Using drupal-composer/drupal-project I simply added one function to its ScriptHandler.php that always symlinks me my own .htaccess from the composer root dir as post-install-cmd and post-update-cmd into the web root dir.
            – leymannx
            1 hour ago














          up vote
          3
          down vote













          In the scripts section 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 require section)






          share|improve this answer




















          • Using drupal-composer/drupal-project I simply added one function to its ScriptHandler.php that always symlinks me my own .htaccess from the composer root dir as post-install-cmd and post-update-cmd into the web root dir.
            – leymannx
            1 hour ago












          up vote
          3
          down vote










          up vote
          3
          down vote









          In the scripts section 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 require section)






          share|improve this answer












          In the scripts section 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 require section)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 1 hour ago









          Stef

          506411




          506411











          • Using drupal-composer/drupal-project I simply added one function to its ScriptHandler.php that always symlinks me my own .htaccess from the composer root dir as post-install-cmd and post-update-cmd into the web root dir.
            – leymannx
            1 hour ago
















          • Using drupal-composer/drupal-project I simply added one function to its ScriptHandler.php that always symlinks me my own .htaccess from the composer root dir as post-install-cmd and post-update-cmd into the web root dir.
            – leymannx
            1 hour ago















          Using drupal-composer/drupal-project I simply added one function to its ScriptHandler.php that always symlinks me my own .htaccess from the composer root dir as post-install-cmd and post-update-cmd into the web root dir.
          – leymannx
          1 hour ago




          Using drupal-composer/drupal-project I simply added one function to its ScriptHandler.php that always symlinks me my own .htaccess from the composer root dir as post-install-cmd and post-update-cmd into the web root dir.
          – leymannx
          1 hour ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdrupal.stackexchange.com%2fquestions%2f271146%2fhow-to-patch-your-htaccess-file-correctly-in-composer-json%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          Confectionery