Redirect s3 object not working

0

I tried to redirect an object by the static website hosting method, but it's not redirecting. How can I solve this? Below the steps I took. Both PDF files are in same S3 bucket. I want:

From

https://bucket-name.s3.eu-west-3.amazonaws.com/downloads/System+drawings/Product_8_system_drawing.pdf

To

https://bucket-name.s3.eu-west-3.amazonaws.com/downloads/Manuals/EN/installation-manual-product-6.pdf

Step 1

I went to the specific bucket and clicked the 'Properties' tab. I editted the Static website hosting. I putted 'Static website hosting' on 'Enable', 'Hosting type': 'Host a static website', 'Index document': 'index.html'. I left all optional settings blank. I didn't uploaded a real index.html file beceause I read it's not necessary. I finalised this step by pressing 'Save changes'.

Step 2

I went to the specific object I wanted to redirect. I scrolled to 'Metadata' and pressed 'Edit'. After that I choosed 'Add metadata'. This is what I entered:

Type: System defined
Key: x-amz-website-redirect-location
Value: /downloads/Manuals/EN/installation-manual-product-6.pdf

I saved changes but it is not working. I tried to remove the first existing metadata row also (System defined, Content-Type, application/octet-stream) but it didn't helped. What am I missing?

asked 4 months ago449 views
2 Answers
0

You have a typo in the metadata property. It should be:

x-amz-website-redirect-location

and not

x-amz-website-relocation

Ref: https://docs.aws.amazon.com/AmazonS3/latest/userguide/how-to-page-redirect.html#redirect-requests-object-metadata

EXPERT
Leo K
answered 4 months ago
  • Thanks, I updated my question. It's a default option when type = System defined, so it is not the case for my problem.

0

Sorry, but you now just have a different typo:

x-amz-website-redirect-relocation

when it should still be:

x-amz-website-redirect-location

The word "relocation" should not appear anywhere.

EXPERT
Leo K
answered 4 months ago
  • Thanks, editted the question another time. Same as before, only typo here because it selected the option x-amz-website-redirect-location from the drop down.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions