I’d like to set a redirect (preferably with RewriteCond) so that if the requested file is index.php regardless of directory, it will be redirected to another site.
So visiting /index.php or/files/index.php or /stuff/index.php (etc.) will all redirect you to another domain.
Here is a general way to do it. This rule set should be placed in the .htaccess file in the root directory:
Redirects permanently any URL that holds
index.phpin any position, likehttp://mydomain.com/index.phporhttp://mydomain.com/any/folder/quantity/index.phporhttp://mydomain.com/any/folder/quantity/index.php/any/folder/quantity/To
http://otherdomain.com/That’s it. You don’t explain much so nothing is passed to the other domain, just as you say in your question:
…redirected to another site.