You can add extra rules right after the ^index\.php$
line via the WP_Rewrite
class, more specifically the add_external_rule()
method. They are added to the non_rewrite_rules
array, which is written in the mod_rewrite_rules()
method.
This is a very simple example. You should still flush the rewrite rules (once), either on plugin activation or by visiting the Permalinks page.
add_action( 'init', 'wpse9966_init' );
function wpse9966_init()
{
global $wp_rewrite;
// The pattern is prefixed with '^'
// The substitution is prefixed with the "home root", at least a "https://wordpress.stackexchange.com/"
$wp_rewrite->add_external_rule( 'images/thumb/(.*)$', 'timthumb.php?filename=$1' );
}