1 Answer
- Newest
- Most votes
- Most comments
1
Hello.
The content type of the object placed in S3 may not be "text/html".
Try changing the content type with the following command.
aws s3 cp --content-type text/html s3://your-bucket-name/index.html s3://your-bucket-name/index.html --recursive
Also, delete the CloudFront cache after making the change.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#Invalidation_Requests
Relevant content
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 8 months ago
Can I do this using the sdk?
Yes, it is possible. This can be done by using "copy_object" as described in the following document. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/copy_object.html