title: Apache and rewrite/redirect in htaccess to different folder
body: <p>I know it's not original question but I've read several posts and questions here and still can't figure it out.</p>
  
  <p>I'm on localhost (apache server) and default server home is in /var/www. There is a folder 'project' with several subfolders, one of them is called web with index.php file. So now if I want to go to index, I need to use full url localhost/project/web/.</p>
  
  <p>I want to make it better so that if you go to localhost/project you are either redirected to localhost/project/web/ or the url remains same but it works (sorry for this naive formulation).</p>
  
  <p>In .htaccess I changed directory index but then all links (since they are relative) were not working.</p>
  
  <p>I tried this .htaccess in /var/www/project:</p>
  
  <pre><code>RedirectMatch permanent ^/$ ./web/
  &lt;Files .htaccess&gt;
  order allow,deny
  deny from all
  &lt;/Files&gt;
  Options -Indexes
  </code></pre>
  
  <p>But it's not working, going to localhost/project tries to list the project directory (it is not allowed due to Options -Indexes, which is what I wanted). I need it to be independent of the 'localhost' in url because it have to work anywhere (if .htaccess is allowed) </p>
  
  <p>Thanks for any advice</p>