First and foremost
Firstly, read and follow the steps on this official instruction from CloudFlare. Do not change the auto-generated DNS rules unless you know what you are doing.
Not working?
Several things you may need to change if your site is not working properly after you completed all the steps. Be aware, it takes a long time for the newly updated DNS to be effective, be patient and do not worry and change things randomly. I waited for about 24 hours.
- You need a
CNAME
file in your repo root, containing only one line:yourdomain.com
ORwww.yourdomain.com
. It decides which domain will response by default. Personally, I prefer the one withwww
- Configure your DNS in CloudFlare:
The first rule enablesyourdomain.com
and the second enableswww.yourdomain.com
- Configure your Page Rules to allow Https connections
Order matters!