title: .htaccess How to redirect root URL to subdirectory files, rewrite to clean URL AND not affect subdomains?
body: <p><em>Haven't been able to find what I'm looking for in .htaccess QA's on here so forgive me if this is duplicate.</em> I have the following problem with a static HTML site. Structure is below. </p>
  
  <p>My relative paths in <code>info.html</code> and <code>contact.html</code> have to use <code>/home/css/style.css</code> while <code>index.html</code> uses <code>/css/style.css</code>. Thanks for help.  </p>
  
  <pre><code>Root
  - .htaccess
  ↳ Drupal
    - .git
  ↳ Dev
    - .git
  ↳ Home
    - .htaccess
    - .git
    - css
    - js
    - img
    - info.html
    - contact.html
    - index.html
  </code></pre>
  
  <p><strong>Goal</strong> </p>
  
  <ul>
  <li><code>Dev.example.com</code> to use all the files from <code>/Dev</code></li>
  <li><code>example.com</code> to use all the files from <code>example.com/home</code></li>
  <li><code>example.com/info</code> to redirect from <code>example.com/home/info.html</code>.</li>
  <li><code>example.com/contact</code> to redirect from <code>example.com/home/contact.html</code>.</li>
  </ul>
  
  <p><strong>What I've tried so far</strong></p>
  
  <p>in root .htaccess</p>
  
  <pre><code>      # Set a default home directory, (this subfolder always loads)
    # RewriteEngine On
    # RewriteCond %{THE_REQUEST} ^GET\ /home/
    # # RewriteCond %{HTTP_HOST} ^(www\.)?example.com$
    # RewriteRule ^home/(.*) /$1 [L,R=301]
  
    # RewriteCond %{HTTP_HOST} ^(www\.)?example.com$
    # RewriteRule !^home/ home%{REQUEST_URI} [L]
  
    Options -Indexes
  
    ErrorDocument 404 /missing.html
  
    # compress text, html, javascript, css, xml:
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch bMSIE !no-gzip !gzip-only-text/html
  
    &lt;FilesMatch "\.(htm|html|css|js)$"&gt;
    AddDefaultCharset UTF-8
    &lt;/FilesMatch&gt;
  
    RedirectMatch 404 "(?:.*)/(?:\.git|file_or_dir)(?:/.*)?$"
  
    # remove .html from html file names
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .*[^/]$ %{REQUEST_URI}/ [L,R=301]
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^(.+)/$ $1.html [L]
  </code></pre>
  
  <p>And in Root/drupal .htaccess</p>
  
  <pre><code>default drupal stuff
  </code></pre>
  
  <p><strong>Closest answers I could find on SO:</strong> </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/990392/htaccess-rewrite-to-redirect-root-url-to-subdirectory">.htaccess rewrite to redirect root URL to subdirectory</a></li>
  <li><a href="https://stackoverflow.com/questions/14073832/changing-all-my-website-links-the-best-way?lq=1">Changing all my website links: what is the best way?</a></li>
  <li><a href="https://stackoverflow.com/questions/6898946/redirecting-root-of-site-to-subdirectory-using-htaccess">Redirecting root of site to subdirectory using .htaccess</a></li>
  <li><a href="https://stackoverflow.com/questions/15209795/htaccess-subdirectory-urls-to-root">htaccess subdirectory URLS to root</a></li>
  </ul>
  
  <hr>
  
  <p><strong>EDIT:</strong> I ended up following, partially, the advice given because I have separate git repos per subdirectory. Thanks @Jon Lin and @tttony! </p>
  
  <p><strong>New problem:</strong> My .htaccess in root doesn't let me view my drupal installation in subfolder.</p>
  
  <ul>
  <li><code>Drupal.examples.com</code> uses all the drupal files from <code>/Drupal</code>**</li>
  </ul>