title: How can I hide folder name from URL using .htaccess
body: <p>I have a website with the root folder 'www', but I put all php files including index.php in a sub-folder of root.
  I wrote myself a .htaccess file to redirect, so if I input <code>www.test.com</code>, it will jump to <code>www.test.com/folder</code> and display the <code>index.php</code>.</p>
  
  <p>Below it's my <code>.htaccess</code> which I put in the root.</p>
  
  <pre><code> RewriteEngine On
   RewriteBase /
   RewriteRule ^folder2 - [L] 
   #ignore folder2 in which I put important files, but no works for the website
   RewriteCond %{REQUEST_URI} !^/folder(.*)
   RewriteRule (.*) /folder/$1
  </code></pre>
  
  <p>Right now, I want to change the .htaccess file to reach these goals:</p>
  
  <ol>
  <li>When I input <code>www.test.com</code>, jump to <code>www.test.com/folder</code> as usual, but display the url without <strong>folder</strong>.</li>
  <li><p>All the pages in folder will display the url without folder name.
  Such as</p>
  
  <p><code>www.test.com/shop/page1</code> -> <code>www.test.com/page1</code></p></li>
  </ol>
  
  <p>I searched some of the scripts, but none of them works.</p>