I have a program writing and updating some RewriteRules in an .htaccess file (the main config is in the vhosts section). This works fine most of the time, but sometimes the file gets corrupt.
When this happens, the server responds with 500 Internal Server Error for every request because the .htaccess file is corrupt.
Is there a failsafe option or something I can configure to tell Apache it should ignore the .htaccess file if it is corrupt but respect it if it is ok?
Or at least is there a tool I can use to check regularly if the .htaccess file is valid (e.g. by cron job) and delete it if it is corrupt?