title: How to change base dir with htaccess
body: <p>I have my whole project in directory <strong>document_root</strong> and I need to redirect there.</p>
  
  <p>I've made simple rewrite rule</p>
  
  <pre><code>RewriteEngine on
  RewriteRule ^(.*)$ document_root/$1 [L]
  </code></pre>
  
  <p>which works just fine if I have </p>
  
  <pre><code>http://someurl.com/?foo=bar
  </code></pre>
  
  <p>but when I do</p>
  
  <pre><code>http://someurl.com/index.php?foo=bar
  </code></pre>
  
  <p>then it is redirected to the <strong>document_root</strong> version, so the url looks like</p>
  
  <pre><code>http://someurl.com/document_root/index.php?foo=bar
  </code></pre>
  
  <p>which I wanted to avoid.</p>
  
  <p>Is there also any way how to block the <strong>document_root</strong> version and send it back to the shorter url version?</p>