Redirect www.mainsite.com/subsite/wp-login to www.mainsite.com/wp-login

I suppose www.mainsite.com is the main blog and www.mainsite.com/subtitle is a dynamic child blog. You can use MU api for this:

add_action("init", function(){
    global $pagenow;

    if ( 'wp-login.php' !== $pagenow ) return;

    global $blog_id;

    $main_blog_ID = 1; // main site ID (use get_current_blog_id() to get ID)

    if ( (int) $blog_id !== (int) $main_blog_ID ) {
        switch_to_blog( $main_blog_ID );
        wp_redirect( wp_login_url() );
        exit;
    }
});

Hope that helps.