Auto redirect based on window.location.