To future-proof, might be worth adding the -L flag which tells curl to follow links.