Registered access area

Ok i solved with this way:

        // Redirect guest users
    function login_redirect() {
        global $pagenow; 
        // If user is not loged in and not in the login page
        if(!is_user_logged_in() && $pagenow != 'wp-login.php')
              auth_redirect();
    }
    add_action( 'wp', 'login_redirect' );