Handle http code 301 and 302