Single htaccess file with distinction between production and development
I am currently using two .htaccess files for my website: one is the development version, and the other one is the production version. The difference is in absolute and some relative paths that are used for `RedirectMatch`, `RewriteRule`, and `ErrorDocument` directives, and that differ between development and production. I am using a git hook to remove the dev version and rename the production version, but this still means I have to maintain two versions of basically the same file. Also, I am encountering similar problems with other sites I manage, so this all means more work. I rather have one single file and some sort of condition in the .htaccess file that allows me to say `if production -> use these, else -> use these`. Can I do such thing in an .htaccess file? 

I have found this:

http://stackoverflow.com/questions/6764237/htaccess-between-developemt-staging-and-production

But this is for rewrite rules and would not fix the different ErrorDocument paths. 
Single htaccess file with distinction between production and development
===

I am currently using two .htaccess files for my website: one is the development version, and the other one is the production version. The difference is in absolute and some relative paths that are used for `RedirectMatch`, `RewriteRule`, and `ErrorDocument` directives, and that differ between development and production. I am using a git hook to remove the dev version and rename the production version, but this still means I have to maintain two versions of basically the same file. Also, I am encountering similar problems with other sites I manage, so this all means more work. I rather have one single file and some sort of condition in the .htaccess file that allows me to say `if production -> use these, else -> use these`. Can I do such thing in an .htaccess file? 

I have found this:

http://stackoverflow.com/questions/6764237/htaccess-between-developemt-staging-and-production

But this is for rewrite rules and would not fix the different ErrorDocument paths. 