0

Our website (hosted on a non-Amazon standard linux box) has a folder called "software" to handle our downloads. in there is an .htaccess file with entries like:

Redirect /software/ourproduct.zip https://somebucket.ourdomain.com/ourproduct-123-4567.zip

With 123 being the version and 4567 being the build number.

When we update the software, we change the .htaccess accordingly. However, some people bookmark the link and we would like to somehow redirect the link:

somebucket.ourdomain.com/ourproduct-123-4567.zip

to

somebucket.ourdomain.com/ourproduct-124-7890.zip

Since this URL never goes through our main web server, but rather only via AWS S3/CloudFront, how can we put a 301 on it so people don't get a 404? I don't want them to get an old version of our software either.

I want this to be easy to update when we release new versions - just like mass editing an .htaccess file is easy.

Trygve
  • 1,123
  • 8
  • 22
  • Does this answer your question? [Amazon S3 Redirect and Cloudfront](https://stackoverflow.com/questions/22740084/amazon-s3-redirect-and-cloudfront) – Brad Apr 24 '20 at 18:11
  • Also, I wouldn't recommend doing what you're asking for. I don't know your specific use case, but if I were a customer, I'd be pretty annoyed if a download link for one version landed me on some other link. Maybe I wanted that particular version. – Brad Apr 24 '20 at 18:12
  • We do keep some versions around for older OS versions, etc. But several download sites seem to grab the redirected URL and assume it is always the current version when it is not. – Trygve Apr 25 '20 at 02:16
  • 1
    Why not consider signing the URL for your S3 resource? That way, if anyone wants to download it, they have to go through your redirector. Or, restrict access by referrer. – Brad Apr 25 '20 at 02:22
  • That's not a bad idea. Thanks for the suggestion. We've used signing for other things so this might work. – Trygve Apr 25 '20 at 03:41

0 Answers0