title: stop .htaccess from redirecting subfolder/index.php to root
body: <p>I have an issue I can't seem to debug. I have tried many solutions and no luck.</p>
  
  <p>When I access a URL with subfolder/index.php I get redirected back to the root page. If I access another page in that subfolder it works fine. I am not sure what is causing this on my code. Here is what I have.</p>
  
  <pre><code>Options +FollowSymLinks -MultiViews 
  # Turn mod_rewrite on
  RewriteEngine On
  RewriteBase /
  
  RewriteCond %{HTTP_HOST} ^domain.com$
  RewriteRule (.*) http://www.domain.com/$1 [R=301,L] 
  
  RewriteCond %{HTTP_HOST} ^www.domain\.com
  RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP
  RewriteRule (.*)\.php$ $1 [R=301] 
  
  # remove index
  RewriteRule (.*)index$ $1 [R=301]
  
  # remove slash if not directory
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} /$
  RewriteRule (.*)/ $1 [R=301]
  
  # add .php to access file, but don't redirect
  RewriteCond %{REQUEST_FILENAME}.php -f
  RewriteCond %{REQUEST_URI} !/$
  RewriteRule (.*) $1\.php [L]
  </code></pre>
  
  <p>Any suggestions? Thanks!</p>