php - ERR TOO MANY REDIRECTS - When redirecting user based on their selected city

one text

So I have a drop-down select that changes a custom field's value in their user profile based on their selected city. If a user chooses 'Detroit' for example, Detroit is then stored in their profile and that data is then used to redirect the customer based on their selection.

An issue I am running into seems to be if the customer selects a NEW different city on the homepage, or on a page deeper in the directory they get met with the TOO MANY REDIRECTS loop.

I understand WHY, I just can't seem to see where my issues are that are causing it.

Any help appreciated. Even if there is an easier, cleaner way to accomplish this.

add_action('wp_footer' , 'city_redirects');
function city_redirects() {
        global $current_user;
        global $wp;
        $current_url = home_url( add_query_arg( array(), $wp->request ) );
        wp_get_current_user(); // wordpress global variable to fetch logged in user info
        $userID = $current_user->ID; // logged in user's ID
        $metalocation_display = get_user_meta($userID, 'location_select', true); // stores the value of logged in user's meta data for 'test'.
        $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

    //chicago REDIRECTS
    if ( is_user_logged_in() && $metalocation_display == 'chicago' && strpos($url,'chicago') == false) {
        header('Location: example.com/chicago/' . $_SERVER['REQUEST_URI']);
        }
    if ( is_user_logged_in() && $metalocation_display !== 'chicago' && strpos($url,'chicago') == true) {
        header('Location: example.com/' . str_replace('chicago', '', 'example.com/chicago') . $_SERVER['REQUEST_URI']);
        }
    if ( is_user_logged_in() && is_front_page() && $metalocation_display !== 'chicago' && strpos($url,'chicago') == true) {
        header('Location: example.com/');
        }
    //detroit REDIRECTS
    if ( is_user_logged_in() && $metalocation_display == 'detroit' && strpos($url,'detroit') == false) {
        header('Location: example.com/detroit/' . $_SERVER['REQUEST_URI']);
        }
    if ( is_user_logged_in() && $metalocation_display !== 'detroit' && strpos($url,'detroit') == true) {
        header('Location: example.com/' . str_replace('detroit', '', 'example.com/detroit') . $_SERVER['REQUEST_URI']);
        }
    if ( is_user_logged_in() && is_front_page() && $metalocation_display !== 'detroit' && strpos($url,'detroit') == true) {
        header('Location: example.com/');
        }
    //philadelphia REDIRECTS
    if ( is_user_logged_in() && $metalocation_display == 'philadelphia' && strpos($url,'philadelphia') == false) {
        header('Location: example.com/philadelphia/' . $_SERVER['REQUEST_URI']);
        }
    if ( is_user_logged_in() && $metalocation_display !== 'philadelphia' && strpos($url,'philadelphia') == true) {
        header('Location: example.com/' . str_replace('philadelphia', '', 'example.com/philadelphia') . $_SERVER['REQUEST_URI']);
        }
    if ( is_user_logged_in() && is_front_page() && $metalocation_display !== 'philadelphia' && strpos($url,'philadelphia') == true) {
        header('Location: example.com/');
        }
}

Source