Try it, it works for me! Make sure you have AllowOverride All in httpd.conf
RewriteEngine On RewriteCond %{REQUEST_URI} index\.php RewriteRule ^(.*)index\.php$ /$1/ [R=301,L]
There is a regex problem in your rules, I changed your rules and it works for me:
RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} index\.php RewriteRule ^index\.php$ http://example\.com/ [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index\.php [L]
source share