The reason is because the -f
checks if the request file exists. On top of that, the rewrite engine will loop through all the rules until the URI stops changing. That means the first time around, say you have the request URI: /foo/bar
- it's not a directory
- it matches
^(.*)
- URI gets rewritten to
index.php?action=foo/bar
next time around, the URI is /index.php
- it's not a directory
- it matches
^(.*)
- URI gets rewritten to
index.php?action=index.php
next time around, it doesn't change so rewriting stops.