Search code examples
amazon-s3httpsssl-certificateamazon-cloudfrontnamecheap

How to change your website from HTTP to HTTPS on AWS S3 CloudFront? (namecheap domain)


I have been trying to follow this tutorial to change my website from HTTP to HTTPS. I have my website set up with a namecheap domain and AWS S3 for hosting. According to the tutorial, I successfully got the SSL certificate. But not sure how to use it to make my website HTTPS. I am having a problem following step 3 of the tutorial

"Under “Default Cache Behavior Settings", select “Redirect HTTP to HTTPS” to try to enforce HTTPS on all requests to CloudFront."

I cannot find a cache behavior setting in cloudfront. I only see my 1 cloudfront distribution. And I am only able to edit these fields:

SO how/where can I find the settings to change it to HTTPS?

enter image description here


Solution

  • You are using an RTMP distribution instead of a CloudFront Web Distribution. Make a new Web Distribution then:

    1. Select your distribution by clicking the checkbox next to its name
    2. Click Disribution Settings
    3. Click Behaviors and click the checkbox next to the Default (*) behavior
    4. Click "Edit" and change "Viewer Protocol Policy" to "Redirect HTTP to HTTPS"
    5. Click "Yes, Edit"

    Note: Make sure you have a valid SSL cert configured

    AWS Docs on Cloudfront HTTP/HTTPS behaviors