Cloudflare setup for redirection
The above link shows how to set up a root domain as a custom domain. But as we are using a www subdomain all steps in this link are not needed.
The following are relevant steps and you can refer to the link for images.
1. Log in to your Cloudflare account.
From the header, click on the ‘+ Add’ option and choose Existing domain. In the space provided enter your domain (eg: worldmusicmethod.com) and click on the ‘Continue’ button.
2. After the scan is completed click on the ‘Continue’ to proceed further. This will add all DNS records you already have, so no worries about breaking anything.
3. Add a CNAME record for your domain, and point it to your Zenler School.
Name: worldmusicmethod.com
Value: www.worldmusicmethod.com
Note: Take a screenshot of the DNS records in the Cloudflare Dashboard now and save it.
So we have added the DNS records in Cloudflare but now you have to tell your domain name provider to use Cloudflare as the DNS from now on. To do that, follow the steps in the link below.
Note: Take a screenshot of the Nameserver values after changing the values and save it.
Now the DNS is handled by Cloudflare. So we will add the redirection rule for worldmusicmethod.com. The steps to redirect the domain worldmusicmethod.com to www.worldmusicmethod.com is given below.
How to set up Cloudflare redirection
We have only set the DNS record for www.worldmusicmethod.com so only www.worldmusicmethod.com will work. (worldmusicmethod.com will not work)
Can you set a redirection/forwarding rule in Cloudflare? This will solve the issue.
Steps to set redirection rule in the Cloudflare dashboard.
1. Log into your Cloudflare account.
2. Click the appropriate Cloudflare account for the domain (worldmusicmethod.com) where you want to add URL forwarding.
3. Click the Page Rules.
4. Under Page Rules, click Create Page Rule. The Create Page Rule for worldmusicmethod.com dialog opens.
5. Under If the URL matches, enter the URL or URL pattern that should match the rule.
6. Next, click Add a Setting.
7. Choose Forwarding URL from the drop-down menu.
8. Click Select Status Code and choose 301 (Permanent Redirect).
9. Enter the destination URL.
10. To finish, click Save and Deploy.