.htaccess remove index.php from subdir redirects all dynamic pages
<p>Trying to remove index.php from and just resolve to the subdirectory name which works, however after making the change to .htaccess file all the other pages redirect to the subdirectory.
<br>For example:<br>
Changed: <code>site.com/subdir/index.php</code> to <code>site.com/subdir/</code> <br>but then <code>site.com/subdir/page?id=4</code> resolves to <code>site.com/subdir/</code></p>

<p><br>
.htaccess:<br></p>

<pre><code>RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]


RewriteBase /subdir/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</code></pre>

<p>How to write this rule so that only index.php resolves to /subdir/ and not the other pages within that directory?</p>