title: Running Slim Framework in a folder of a subdomain
body: <p>I have set up a subdomain for my API <code>api.server.com</code>. I can run my app here but I want to run it in a folder of this subdomain specifically v1. When I try this I just get <code>404</code>.</p>
  
  <p>I have modified my <code>.htaccess</code> with a multiple of paths all the way back to root with no joy. </p>
  
  <pre><code>   RewriteEngine On
  
     # Some hosts may require you to use the `RewriteBase` directive.
     # If you need to use the `RewriteBase` directive, it should be the
     # absolute physical path to the directory that contains this htaccess file.
     #
     # RewriteBase /
     RewriteBase /all/the/way/back/to/root/www/api/v1/
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^(.*)$ index.php [QSA,L]
     RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
  </code></pre>
  
  <p>I have tried every posibilty here.</p>
  
  <pre><code>  /all/the/way/back/to/root/www/api/v1/
    /the/way/back/to/root/www/api/v1/
    /way/back/to/root/www/api/v1/
    /back/to/root/www/api/v1/
    /to/root/www/api/v1/
    /root/www/api/v1/
    /www/api/v1/
    /api/v1/
    /v1/
  </code></pre>
  
  <p>But still get 404. Any suggestions to solve this?</p>
  
  <p>This is the actual .htaccess for www/api/v1</p>
  
  <pre><code>  RewriteEngine On
  
    # Some hosts may require you to use the `RewriteBase` directive.
    # If you need to use the `RewriteBase` directive, it should be the
    # absolute physical path to the directory that contains this htaccess file.
    #
    # RewriteBase /
    RewriteBase /api/v1/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
  
    RewriteRule ^(.*)$ index.php [QSA,L]
    RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
  </code></pre>
  
  <p>I want to use the main domain as the api website</p>
  
  <p>running the below script </p>
  
  <pre><code>  &lt;?php 
    //Gets the document root 
    $root = getenv("DOCUMENT_ROOT") ; 
    Echo $root; 
    ?&gt; 
  </code></pre>
  
  <p>gives me <code>/var/www/domainname.com/web</code></p>