Codeigniter htaccess redirect to index.php only on root directory
<p>I have structure directory in Codeigniter like this</p>

<pre><code>/application
/assets
/system
.htaccess
index.php
test.php
</code></pre>

<p>And this is my .htaccess file</p>

<pre><code>RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
</code></pre>

<p>What i want is, if user access any other PHP or HTML file except index.php, it'll be redirected to index.php. For example, if someone access test.php, it'll be redirected to index.php. But i want it only work for root directory and not effected to other directory</p>

<p>I've already try from <a href="https://stackoverflow.com/questions/23025312/htaccess-only-allow-access-and-redirect-to-root-index-php-for-only-one-director?rq=1">here</a> but it didn't work for me</p>