How to Redirect/Forward a Domain with Cloudflare (Supports HTTPS)
Table of Contents
Do you want to redirect or forward a domain using Cloudflare? In this tutorial, we will cover the easy and detailed steps to redirect your domain using Cloudflare services. This guide supports HTTPS and is beginner-friendly.
Preparing Your Cloudflare Account
Log in to your Cloudflare account via https://dash.cloudflare.com. If you don’t have an account yet, please sign up first.
Adding a Domain to Cloudflare
Once logged in, click the Add Domain button.
In the
Add an existing domain
form, enter your domain name, then click Submit.Select the Free Plan package (sufficient for basic needs). Click Continue and proceed until the DNS scan process is complete.
Setting Cloudflare Nameservers
Cloudflare will provide instructions to change your domain’s nameservers to Cloudflare’s nameservers.
You can find guidance for changing nameservers from your domain registrar.
Make sure to follow these steps correctly.
Checking DNS Propagation
To ensure the nameservers are correct, you can check them via a site like whois.com.
After pointing the nameservers to Cloudflare, wait for DNS propagation for about 30 minutes to 1 hour.
Creating Page Rules for Redirection
Go to Rules > Page Rules > Create Page Rules.
Set up your redirect URL. For example:
- URL:
yourdomain.com/*
(wildcard for all pages). - Setting: Forwarding URL
- Status: 301 (permanent redirect)
- Destination: Enter your redirect destination URL.
- URL:
Don’t forget to add a rule for your
www
subdomain as well.
Configuring DNS Records
Go to the DNS > Records menu, then click Add Record.
Add an A Record with a random IP (e.g.,
104.17.111.184
). This will not affect the redirect because the domain is already set to forward.- Add for
@
(root domain). - Also, add for
www
.
- Add for
Testing Domain Redirection
Wait for about 10 minutes, then test the redirection.
You can use tools like What’s My DNS Redirect Checker.
Conclusion
By following this tutorial, you can easily redirect or forward a domain using Cloudflare. This method supports HTTPS, ensuring the security and reliability of your website. Feel free to try it out, and make sure all steps are completed correctly.
I hope this article is helpful! If you have any questions. 😊