title: how can I define variable in .htaccess file and use it?
body: <p>I have defined an htaccess file for my website having this code:</p>
  
  <pre><code>RewriteEngine on
  RewriteBase /
  
  RewriteRule ^bit_auth\/?(.*)$ /cig/base3/auth/$1 [R=301,NC,L]
  RewriteCond $1 !^(index\.php|images|robots\.txt|assets|themes|includes)
  RewriteRule ^(.*)$ /cig/base3/index.php/$1 [L]
  </code></pre>
  
  <p>I want to <strong>keep my site root path in a variable</strong> like this:</p>
  
  <pre><code>RewriteEngine on
  RewriteBase /
  SetEnv BASE_PATH "/cig/base3"
  
  RewriteRule ^bit_auth\/?(.*)$ %{ENV:BASE_PATH}/auth/$1 [R=301,NC,L]
  RewriteCond $1 !^(index\.php|images|robots\.txt|assets|themes|includes)
  RewriteRule ^(.*)$ %{ENV:BASE_PATH}/index.php/$1 [L]
  </code></pre>
  
  <p>because I may need to use <code>BASE_PATH</code> value in more codes later and also it may be changed and I don't want to search and replace every time in my htaccess file.
  But when I use code above, <strong>in htaccess file <code>%{ENV:BASE_PATH}</code> is returning an empty value rather than expected <code>/cig/base3</code></strong> but <strong>in php when I call it using:</strong></p>
  
  <pre><code>&lt;?php $specialPath = getenv('BASE_PATH'); var_dump($specialPath)?&gt;
  </code></pre>
  
  <p><strong>it is showing the correct value of <code>/cig/base3</code>.</strong></p>
  
  <p>Whats the problem in my codes and how can I solve this?</p>