Sorry, but that is incorrect!!
After doing lots of reading on my own, I would say this…
In the first line…
RewriteCond %{THE_REQUEST} ^.*/index\.php
The TestString is %{THE_REQUEST} which provides the full HTTP request line sent by the browser (e.g. “GET /music/index.php HTTP/1.1”)
And the Condition is any character combination from 0 to many preceding “/index.php”. In my example, that would be “/music”.
(Originally, I was thinking that {THE_REQUEST} was the whole URL like: http://www.acme.com/music/index.php but it is not. Instead, it is whatever comes after the hostname, for example, “/music/index.php”)
In the second line…
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
The Pattern is any character combination from 0 to many preceding “index.php”. In my example, that would be “/music”.
The Substitution is a slash / followed by whatever is found in the first grouping. In this case, that is (.*) which equates to “/music” in my example.
So the RewriteRule yields “/music”.
And so the original URL of:
http://www.acme.com/music/index.php
Would be changed to by the mod_rewrite to:
http://www.acme.com/music
So in summary, the mod_rewrite is simply chopping off the “/index.php” portion…
To be honest, this mod_rewrite should be tweaked a little, because I would never have an intermediary folder structure (e.g. “/music”) between the host name (“www.acme.com”) and any “index.php” file, but I guess that makes my current code more scalable!