handle http redirect