Best way to create a login page and redirect

What is the best way to create a registration page and a login page and then redirect the login to either the admin or a front end page depending on the logged-in person’s permissions?