7

I wish to create redirect object.

It is redirect to JSON file. HTML expires header will not work for me.

touch google
s3cmd --add-header='Location: http://www.google.com/' -P put google s3://bucket/google

It does not work as I do not set HTTP sttaus to 302

I prefer s3cmd as it is already installed on target server but python might ok as well if s3cmd can't do that.

Eugene
  • 257
  • 1
  • 6

1 Answers1

5

You should set x-amz-website-redirect-location header when putting object and access it via region specific website endpoint to archive this. See the document here: http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html

petertc
  • 3,607
  • 1
  • 31
  • 36