title: .htaccess between developemt, staging, and production
body: <p>I'm working on a app that uses url rewrites and has a specific .htaccess configuration. When working on the app I have three eviorments:</p>
  
  <ol>
  <li>Developent on my local machine (localhost)</li>
  <li>Staging (staging.mydomain.com)</li>
  <li>Production (www.mydomain.com)</li>
  </ol>
  
  <p>I am constantly pushing new upgrades to the staging and production environment and each time I overwrite the existing source code I have to go in an change the .htaccess file. Is there a way I can the .htaccess generic to the directory or have it automatically detect it's environment?</p>
  
  <p>My current .htaccess file is below. I just un-comment the sections between the different environments but would love to stop doing that...</p>
  
  <pre><code># Development
  
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ /app/index.php?request=$1 [L,QSA]
  
  # Staging
  
  # RewriteEngine on
  # RewriteCond %{REQUEST_FILENAME} !-f
  # RewriteCond %{REQUEST_FILENAME} !-d
  # RewriteCond %{REQUEST_URI} !=/favicon.ico
  # RewriteRule ^(.*)$ /html/app/index.php?request=$1 [L,QSA]
  
  # Production
  
  # RewriteEngine on
  # RewriteCond %{REQUEST_FILENAME} !-f
  # RewriteCond %{REQUEST_FILENAME} !-d
  # RewriteCond %{REQUEST_URI} !=/favicon.ico
  # RewriteRule ^(.*)$ /index.php?request=$1 [L,QSA]
  </code></pre>
  
  <p>Thanks in advance!</p>
  
  <p>Chuck</p>