handling 302 & 301 redirect caused by overzealous url sanitizing