We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47717
    • 144 Posts
    Hi,

    Is there a possibility to change the .htaccess file dynamically, when a particular Modx-setting is changed ?

    (It is to make my client to switch on/off the Varnish Cache of the one.com hosting, and I don't want him to dive in the htaccess code himself, even if it's only changing a "#" on one line).

    Thanks !
      • 3749
      • 24,544 Posts
      There's no System Event fired for a change in a System Setting. If there were, you could do it pretty easily in a plugin. ClientConfig lets you set System Settings, but I don't think it fires any events or allows any postHooks.

      You could create a form with a couple of radio options and use a custom snippet to process it. The snippet could set the System Setting, and rewrite .htaccess. The change wouldn't take effect until the next request.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting