Included in one our system's we enable a person within the backoffice to include a block of 301 redirects should they have to. Case a textarea which in turn populates a particular section of b .htaccess file. Around this might appear insecure it's only formerly used internally by individuals who know what they're doing however for various reasons they can't access the particular file. We want how to allow more use of this function, not for everyone, however for people who most likely have much less understanding of regexp etc and syntax in htaccess files. Clearly the main concern this is actually the user makes its way into some bad syntax and makes all of their site, such as the backoffice where they might fix the problem, totally inaccessible without manual intervention. What approaches can one decide to try make certain that they don't break their website? A htaccess syntax check? copy the file elsewhere and appearance it does not produce a 500 error (with cURL or similar)?. Would welcome any ideas.
For ingenous customers you need to produce a Tool that only accepts the information for that specific task, validates it and adds it towards the htaccess.