title: Configure MAMP to treat each directory in Htdocs as Root in Apache mod_redirect
body: <p>The issue is that when using MAMP for local development, the <code>.htaccess</code> file needs to differ in that the <code>RewriteBase</code> needs to specify the subdirectory for the specific site (as shown <a href="https://stackoverflow.com/questions/25435621/htaccess-mod-rewrite-and-mamp">here on SO</a>).</p>
  
  <p>Is there a way to configure MAMP <code>MAMP/conf/apachehttpd.conf</code> so that each virtual site gets it's own "root"?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After getting a clue about Virtual Hosts:</p>
  
  <p>Have updated <code>/etc/hosts</code> file to include:</p>
  
  <pre><code>127.0.0.1       ClientSite.localhost
  </code></pre>
  
  <p>Uncommented the line:</p>
  
  <pre><code>`#Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf` 
  </code></pre>
  
  <p>in <code>/Applications/MAMP/conf/apache/httpd.conf</code>.</p>
  
  <p>There is a directory called <code>ClientSite</code> in <code>/Users/myname/Sites/</code>.</p>
  
  <p>This is the <code>/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf</code> content:</p>
  
  <pre><code>NameVirtualHost *:80
  &lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@dummy-host.example.com
      ServerName localhost
      ServerAlias *.localhost
      VirtualDocumentRoot /Users/myname/Sites/%0
  
      RewriteLogLevel 3
      RewriteLog "/Applications/MAMP/logs/rewrite.log"
  
      &lt;Directory /Users/myname/Sites&gt;
         Options All
         AllowOverride All
         Order allow,deny
         Allow from all
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Restarted the MAMP servers (and even ran <code>dscacheutil -flushcache</code>).</p>
  
  <p>When browser is pointed to <code>ClientSite.localhost</code> it returns a <code>404</code>: <code>The requested URL / was not found on this server.</code></p>