title: Rewrite/hiding some URL in .htaccess
body: <p>I'm trying to get right syntax for .htaccess without any result...</p>
  
  <p>I've a URL structured as domain.com/app/public/pageName .</p>
  
  <p>It's working fine but I would "hide" the 'app/public/' part in browsers, basically doing something like:</p>
  
  <pre><code>[real URL] domain.com/app/public/pageName -&gt; domain.com/pageName [what users type and see in browsers]
  </code></pre>
  
  <p>I think in that way it should be more readable and seo-friendly.</p>
  
  <p>As I understood from docs (and maybe it's wrong because it's not working...) I should tell to Apache to map/redirect all URL like domain.com/pageName to domain.com/app/public/pageName , but only internally, in order to show the minimal URL in users' browsers.</p>
  
  <p>Right now I have something like:</p>
  
  <pre><code>RewriteEngine on
  
  #RewriteBase /app/public/
  
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  
  RewriteRule ^(.+)$ https://localhost/app/public/index.php?url=$1 [QSA,L]
  </code></pre>
  
  <p>(I'm using full URL with https://... in order to get something that will be quick and easy to adapt when I upload all to my hosting, is it right?).</p>
  
  <p>Problem is that RewriteRule actually change the URL, because it perform a redirect and URL rewrite it's not handle internally.</p>
  
  <p>So, first of all: is it possible what I'm trying to do? If so, how can I handle the URL rewrite only internally?</p>
  
  <p>Everything should be uploaded to a shared hosting, so I don't have other than .htaccess.
  Anyway, I can consider to upgrade to a vps if there are not other possibilities...</p>
  
  <p>Thanks!</p>
  
  <p>==============</p>
  
  <p><strong>EDIT</strong> (should be more clear now)</p>
  
  <p>tl;dr version:</p>
  
  <p>I'm looking for a method that let users to type domain.com/pageName (and they will see that address in their browsers) and rewrite internally that URL in order to point to domain.com/app/public/pageName.</p>
  
  <p>==============</p>
  
  <p><strong>More</strong>: after /app/public/ there can be an arbitrary number of elements, separated by / . All of these elements are appended at the end of the URL after index.php. At the end URL looks like: </p>
  
  <pre><code>  domain/app/public/index.php?url=lot/of/elements/here 
  </code></pre>
  
  <p>This is already working with the RewriteRule posted above, I would keep that too.
  Thanks!</p>