Use cURL not wget, and make sure you follow redirects