def parse_url
fix redirect bug