Handle properly redirection, whether it's an ajax call or not.