title: .htaccess in subfolder work partially
body: <p>The website's structure is the next:</p>
  
  <p>www.mydomain.com -> Here is installed wordpress. <br>
  www.mydomain.com/subfolder1 ->  Here is installed a custom php Application.
  www.mydomain.com/subfolder1/subfolder2 -> Here is installed Control panel of php Application.
  </p>
  
  <p>I have an .htaccess in subfolder1 and another in subfolder2, the navigation in subfolder1 is great, but the navigation in the subfolder2 is wrong;<br><br> I can see the www.mydomain.com/subfolder1/subfolder2/index.php but if i want navigate in the menu i.e www.mydomain.com/subfolder1/subfolder2/test the url change, but i see always the index.php</p>
  
  <p>Any advices?</p>
  
  <p>.htaccess in subfolder1</p>
  
  <pre><code>Option -Indexes
  ErroDocument 404/404.php
  RewriteEngine On
  RewriteBase /subfolder1/
  
  #Remove extra trailing slashes
  RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
  RewriteRule . %1/%2 [R=301,L]
  
  #Add missing trailing slash
  RewriteCond %{REQUEST_URI} /+[^\.]+$
  RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
  
  RewriteRule /(uploads/.*) $1 [R=301,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?$1 [L,QSA]
  
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s(.*)/index\.php [NC]
  RewriteRule ^ %1 [R=301,L] 
  
  &lt;ifModule mod_deflate.c&gt;
  &lt;filesmatch "\.(js|css|html|jpg|png|gif|eot|woff|ttf|svg)$"&gt;
      SetOutputFilter DEFLATE
  &lt;/filesmatch&gt;
  &lt;/ifModule&gt;
  
  &lt;FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|cache|tpl)$"&gt;
    Order Allow,Deny
    Deny from all
  &lt;/FilesMatch&gt;
  </code></pre>
  
  <p>.htaccess in subfolder2 is similar subfolder1 but i have changed the RewriteBase</p>
  
  <pre><code>Option -Indexes
  ErroDocument 404/404.php
  RewriteEngine On
  RewriteBase /subfolder1/subfolder2/
  
  #Remove extra trailing slashes
  RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
  RewriteRule . %1/%2 [R=301,L]
  
  #Add missing trailing slash
  RewriteCond %{REQUEST_URI} /+[^\.]+$
  RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
  
  RewriteRule /(uploads/.*) $1 [R=301,L]
  
  RewriteCond %{REQUEST_URI} ^/subfolder2(.+)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  
  RewriteRule ^(.+)$ subfolder2/index.php?url=$1 [QSA,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?$1 [L,QSA]
  
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s(.*)/index\.php [NC]
  RewriteRule ^ %1 [R=301,L] 
  
  &lt;ifModule mod_deflate.c&gt;
  &lt;filesmatch "\.(js|css|html|jpg|png|gif|eot|woff|ttf|svg)$"&gt;
      SetOutputFilter DEFLATE
  &lt;/filesmatch&gt;
  &lt;/ifModule&gt;
  
  &lt;FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|cache|tpl)$"&gt;
    Order Allow,Deny
    Deny from all
  &lt;/FilesMatch&gt; 
  </code></pre>