I can't quite figure out how to use a regex in my .htaccess file to remove index.php from the end of a URL if and only if it is the last thing in the string.
If the url is example.com/path/index.php, it should turn into: example.com/path/
But if the url is example.com/path/index.php?blah=0, it should stay the same.
Any help here? I thought this might work, but it doesn't seem to preserve the latter case above:
RewriteRule ^(.*)$ /index.php/$1 [L]
Use