fix redirection to shortest URL