title: With mod_rewrite can I specify a RewriteBase within a RewriteCond?
body: <p>I'd like to have my .htaccess file specify a different RewriteBase depending on whether the .htaccess file is on my local machine or on a web server.  This is the mod_rewrite code I tried, however, it did not work:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^localhost:8080
  RewriteBase /example/
  RewriteCond %{HTTP_HOST} ^www.example.com
  RewriteBase /
  </code></pre>
  
  <p>This would come in handy for easily previewing several websites on my local machine and then being able to upload those sites to web servers for individual domain names.</p>