In this article, we're going to show you how to redirect a domain on Cloudflare. This is especially useful if you have moved your website, still have the old domain, and want to point it to the new location without having to use the HTAccess method or a CNAME record.
This question could also look like this: "How do I use Cloudflare DNS records to redirect my domain?"
The first thing to note is that you do not use DNS to redirect a domain. DNS is not created for that. Instead, you will use Cloudflare page rules. Even if you're on a Cloudflare free plan, and you're looking to redirect your domain, you have access to three free page rules. For a simple redirect, you only need one period let's talk about how to redirect your domain on Cloudflare, no matter what your plan tier is.
The first step is navigating to the page rules tab of your Cloudflare dashboard. This is not under DNS, instead it is under its own section. Once you're on the page rules tab, go ahead and click on create a new page rule button.
First, type in your root name, with a slash after it, and after an *. What this do is create a catchall redirection rule, so if the domain matches anything under that route, it will redirect to the new location.
Under then these settings are, select the forwarding URL option. Finally, enter the URL that you would like your Cloudflare domain to redirect to within the respective input field.
Finally, apply the rule, and your old domain will now forward to the new one. Any URL underneath it will forward to the applied domain as well.
The one other thing I would do is delete all the DNS records except for a cname WWW pointing to the original domain, and setting the original domain to have an A record pointing to 22.214.171.124. That IP is just a basic placeholder that has been used since the Internet was invented.
If your Cloudflare domain redirection is not working, ensure that it is being proxied through the service. That means that you need to have the a record with the orange cloud showing. If the cloud is Gray then it is not proxy through the service and the page rule will not apply to it.