I know this is an old question, but for others who are looking for a REAL answer , here it is:
The [L] DOES flag works in .htaccess . It tells the rewrite module skip all of the following rules in this particular .htaccess file. It does its job, Apache rewrites the url and exits the .htaccess file.
However, at the end of the .htaccess file , if the request URL has been rewritten, the entire URL mapping process starts again with the new URL .
This is what happens above, ^(.*)$ Will always match the current URL, it causes an infinite loop, only the maxredirect rewrite parameter (default 10) stops it.
Testing the !-f file attribute (as mentioned by the questionnaire) will solve the problem , as the URL will match the true file name:
RewriteCond% {REQUEST_FILENAME}! -f
RewriteRule ^ (. *) $ Dispatch.fcgi / $ 1 [L, QSA]
now if we request http://example.com/toappend , .htaccess overwrite it before dispatch.fcgi/toappend and the loop will not be rewritten .
Denes papp
source share