Changing WordPress routing to load the same page for different URLs

I ended up using add_rewrite_rule:

function bones_rewrite_rules() {
    $gallery_page_id = 395; 
    add_rewrite_rule('^gallery/img-.*', 'index.php?page_id=' . $gallery_page_id, 'top');
}
add_action('init', 'bones_rewrite_rules');

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)