The step-by-step guide to create a domain redirect with Cloudflare
Redirecting a whole domain using Cloudflare can be useful but isn’t documented anywhere, here’s how to do it.
- Be logged into your dashboard.
Select the domain you want to redirect from
Go to page rules
Click “Create page rule”
your.domain/*(matches all traffic) for which URLs will have their traffic redirected
Click “Add a Setting”
Select “Forwarding URL”
Select the type of redirect, I recommend 302s since they’re less aggressively cached (so if you ever want to use that domain to do something else other than redirect, you can)
Enter your forwarding URL
Click “Save and Deploy”
You’re done, you’ve just created a redirect from your domain to another one 🙂
Get The Jest Handbook (100 pages)