redirect to correct locations on login and registration