lucy24 - 11:51 pm on Dec 12, 2012 (gmt 0)
Got it. You don't have blahblah/index.php/blahblah pages, but buried among the robots and spammers you have some bona fide blahblah/index.php/blahblah links. If there's a manageable number of them you're definitely better off with RewriteRules that name those specific files. And if the filenames are in the form
it should be pretty painless because there's only one capture per page and you don't have to worry about matching up the "before" and "after" parts. The Rule will look something like
RewriteRule ^index\.php/(goodname1|goodname2|goodname3)$ http://www.example.com/$1 [R=301,L]
and you don't even need to look at the Request because no apache mod will ever insert "index.php" into the middle of a name. Then you make a separate RewriteRule for the ones with index.php at the end, where you do need a Condition.