Fix client-side redirect behavior