title: Using custom environment variables in .htaccess
body: <p>I need something like this:</p>
  
  <pre><code>SetEnv foo bar.baz
  RewriteEngine On
  
  RewriteCond %{HTTP_HOST} ^%{foo}$
  RewriteRule ^(.*)$ http://www.foo/$1 [L]
  </code></pre>
  
  <p><strong>UPD:</strong></p>
  
  <p>I have made as follows:</p>
  
  <pre><code>SetEnv HOSTNAME_ENV testsite
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^%{ENV:HOSTNAME_ENV}
  RewriteRule ^(.*)$ http://www.%{ENV:HOSTNAME_ENV}/$1 [L,R=301]
  </code></pre>
  
  <p>But it doesn't work. %{ENV:HOSTNAME_ENV} is not defined.</p>