I need to remove index.php from inner pages so that the URL path like /index.php/path would be just /path. But at that if the path is /index.php/ then not to remove index.php and leave everything as is. I try the following lines in my .htaccess:
RewriteCond %{REQUEST_URI} !^.*/index.php/$ [NC]
RewriteRule /index.php/(.+)$ /$1
But they remove index.php always including when the path is /index.php/