Redirect based on members roles

@j.d. thanks for the code; however, when I am using this any visitor is forced to my login page and can’t explore any of the website that is non-member. Any thoughts on troubleshooting this?