Redirect to proper url if not logged in