title: Change root directory in .htaccess
body: <p>I have a problem with changing the root directory in .htaccess.</p>
  
  <p>My folder structure looks like <a href="http://i.stack.imgur.com/YDnuH.png" rel="nofollow">this</a>.</p>
  
  <p>What I want to achieve is, when I visit this page:</p>
  
  <p>/comparty/about/</p>
  
  <p>The page I will see is this page:</p>
  
  <p>/comparty/pages/about/</p>
  
  <p>I have already tried to search on Google, but the code I found did not work, though I tried to change it:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /comparty/
  RewriteRule ^(.*)$ pages/$1 [L]
  </code></pre>
  
  <p>I don't want it to redirect, I want to keep the same URL. Also I've had a big problem with Apache caching the .htaccess file, so I haven't been able to test many things.</p>
  
  <p>Thanks in advance.</p>
  
  <h1>EDIT</h1>
  
  <p>I found a way to rewrite the URL from /comparty/pages/about/ to /comparty/about/ - this is the code:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /comparty/
  RewriteRule ^about/(.*)$ pages/$1 [L]
  </code></pre>
  
  <p>This only works on the about page, though. What would I have to do, to make it dynamic and work with every page?</p>