Using a $GET parameter from a URL, to redirect to a URL (WordPress)

I suggest researching add_query_arg. You can use it like this:

$params_array = array();

foreach($_GET as $key => $param){
    $params_array[] = $key . '=' . urlencode($param);
}

$url = get_permalink(ID) . '?' . implode('&', $params_array);

wp_redirect( esc_url_raw( add_query_arg( 'login', 'empty', $url ) ) );

or you can add multiple params like this:

$params_array = array();

foreach($_GET as $key => $param){
    $params_array[] = $key . '=' . urlencode($param);
}

$url = get_permalink(ID) . '?' . implode('&', $params_array);

$args = array(
    'login' => 'empty'
    'param2' => 1
);

wp_redirect( esc_url_raw( add_query_arg( $args, $url ) ) );

There is also an optional $url param, without it $_SERVER['REQUEST_URI']( or the current url) is used as the subject url, and since it’s the current url (with params) that you need it will just append the new param(s) right to the end of your url.

Note the esc_url_raw, the add_query_arg function doesn’t escape by default, calling for a “late escape”, technically you could use esc_url also, but it’s not needed since you aren’t displaying the link.