Cloudflare: Redirect all traffic to HTTPS

Cloudflare: Redirect all traffic to HTTPS

Setting up Cloudflare to only use HTTPS is pretty straightforward:

Always Use HTTPS
Always Use HTTPS
  • Login to Cloudflare >> select the site
  • Go to SSL/TLS tab >> Edge Certificates
  • Turn ON "Always Use HTTPS"

The other way is to use page rules.

Page Rule
Page Rule
  • Go to Page Rules
  • Click "Create Page Rule"
  • Enter the URL (put the asterisk, so all URLs are redirected)
  • Click "Add a Setting" and select "Always Use HTTPS" from the drop-down
  • Click "Save and Deploy"

After a few minutes, all URLs will be directed via HTTPS. Check your site for mixed content (HTTPS vs. HTTP); having HTTP assets will cause your site to break.