How to add exception to WordPress’s web.conf

If you make the file non-writable by the webserver, then WordPress won’t attempt to rewrite it, because it checks that it is writable before writing to it. So your custom rules can be preserved in this manner.