Prevent .htaccess syntax error
Within one of our systems, we allow the user in the backoffice to add a block of 301 redirects, if necessary. It's just a text box that then populates a specific area of the .htaccess file. As insecure as it may seem, it has only been previously used internally by people who know what they are doing, but for various reasons, they cannot access a specific file. We need to provide more access to this feature now, not to the general public, but to people who probably have a lot less knowledge of regex, etc. And syntax in htaccess files. Obviously the main problem here is that the user enters some kind of bad syntax and makes their entire site, including backoffice, where they can fix this problem.completely inaccessible without manual intervention. What approaches can I take to make sure they don't break my site? Htaccess syntax checker? copy the file somewhere else and check if it generates a 500 error (with cURL or similar) ?. Any ideas are welcome.
Thanks.
a source to share