do a smart redirect.