Redirect to URL condition not working