Make wget retry original URL after 3XX Redirect
<p>I have a service that redirects users to temporary pre-signed AWS downloads. These are large files, often 5-10gb. To prevent download sharing, we have a relatively short (30 seconds) valid lifespan. </p>

<p>Everything is working except that on slow internet connections, they tend to fail or get interrupted.  wget has a feature that automatically retries the download. However, instead of retrying the original URL (eg: <a href="http://service.com/download/file.zip" rel="nofollow">http://service.com/download/file.zip</a>), wget retries the redirected pre-signed URL (eg: <a href="http://service.s3.amazonaws.com/file.zip?AWSAccessKeyId=XXXX&amp;Signature=XXXX&amp;Expires=1468000000" rel="nofollow">http://service.s3.amazonaws.com/file.zip?AWSAccessKeyId=XXXX&amp;Signature=XXXX&amp;Expires=1468000000</a>)</p>

<p>Since these are large files, and the pre-signed lifespan is so short, that temporary url is no longer valid and the user gets a 403 Forbidden result. </p>

<p>Originally, when we noticed the problem, we were using <strong>302 Found</strong> temporary redirects. A little research seemed to indicate we SHOULD have been using <strong>307 Temporary Redirect</strong>. However, that didn't resolve the problem with wget. For grins and giggles, we tried <strong>303 See Other</strong>, but that didn't work either. </p>

<p>Does anyone have any idea how get wget to retry the original URL instead of the redirected URL?</p>

<p>below is a wget example log:</p>

<blockquote>
  <p>--2016-07-06 10:29:51--  <a href="https://service.com/download/file.zip" rel="nofollow">https://service.com/download/file.zip</a></p>
  
  <p>Connecting to service.com (service.com)|10.0.0.1|:443... connected.</p>
  
  <p>HTTP request sent, awaiting response... 302 Found</p>
  
  <p>Location:
  <a href="https://service.s3.amazonaws.com/file.zip?AWSAccessKeyId=XXXX&amp;Signature=XXXX&amp;Expires=1468000000" rel="nofollow">https://service.s3.amazonaws.com/file.zip?AWSAccessKeyId=XXXX&amp;Signature=XXXX&amp;Expires=1468000000</a>
  [following]</p>
  
  <p>--2016-07-06 10:29:52-- <a href="https://service.s3.amazonaws.com/file.zip?AWSAccessKeyId=XXXX&amp;Signature=XXXX&amp;Expires=1468000000" rel="nofollow">https://service.s3.amazonaws.com/file.zip?AWSAccessKeyId=XXXX&amp;Signature=XXXX&amp;Expires=1468000000</a></p>
  
  <p>Resolving service.s3.amazonaws.com (service.s3.amazonaws.com)...
  54.231.12.129</p>
  
  <p>Connecting to service.s3.amazonaws.com
  (service.s3.amazonaws.com)|54.231.12.129|:443... connected.</p>
  
  <p>HTTP request sent, awaiting response... 200 OK</p>
  
  <p>Length: 2070666907 (1.9G) [application/zip]</p>
  
  <p>Saving to:  ‘file.zip’</p>
  
  <p>file.zip 53%[=========> ] 1.03G --.-KB/s in 18m 7s </p>
  
  <p>2016-07-06 10:47:59 (995 KB/s) - Read error at byte
  1107205784/2070666907 (The  specified session has been invalidated for
  some reason.). Retrying.</p>
  
  <p>--2016-07-06 10:48:00-- (try: 2) <a href="https://service.s3.amazonaws.com/file.zip?AWSAccessKeyId=XXXX&amp;Signature=XXXX&amp;Expires=1468000000" rel="nofollow">https://service.s3.amazonaws.com/file.zip?AWSAccessKeyId=XXXX&amp;Signature=XXXX&amp;Expires=1468000000</a></p>
  
  <p>Connecting to service.s3.amazonaws.com
  (service.s3.amazonaws.com)|54.231.12.129|:443... connected.</p>
  
  <p>HTTP request sent, awaiting response... 403 Forbidden</p>
  
  <p>2016-07-06 10:48:01 ERROR 403: Forbidden.</p>
</blockquote>