Rewrite gets completely ignored

Your rerite rule is incorrect. It should be (assuming download is name or slug of the page):

add_rewrite_rule('^download/([^/]+)/?$', 'index.php?pagename=download&file=$matches[1]', 'top');

Also, you need to declare the file query var. A sample and working code:

function createRewriteRules() {
    add_rewrite_tag('%file%', '([^&]+)');
    add_rewrite_rule('^download/([^/]+)/?$', 'index.php?pagename=download&file=$matches[1]', 'top');
}
add_action('init', 'createRewriteRules');

Note: Don’t forget to flush rewrite rules after adding new rewrite rules.