Modified download_url() to support automatic redirection.