How to Redirect/Forward a Domain with Cloudflare (Supports HTTPS)

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

  1. Log in to your Cloudflare account via https://dash.cloudflare.com. If you don’t have an account yet, please sign up first.

    Login Cloudflare


Adding a Domain to Cloudflare

  1. Once logged in, click the Add Domain button.

    Add Domain

  2. In the Add an existing domain form, enter your domain name, then click Submit.

    Form Add Domain

  3. Select the Free Plan package (sufficient for basic needs). Click Continue and proceed until the DNS scan process is complete.

    Select Free Plan


Setting Cloudflare Nameservers

  1. 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.
    Cloudflare Nameservers

  2. Make sure to follow these steps correctly.


Checking DNS Propagation

  1. To ensure the nameservers are correct, you can check them via a site like whois.com.

  2. After pointing the nameservers to Cloudflare, wait for DNS propagation for about 30 minutes to 1 hour.

    Check Whois


Creating Page Rules for Redirection

  1. Go to Rules > Page Rules > Create Page Rules.

    Page Rules

  2. 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.

    Set Page Rules

  3. Don’t forget to add a rule for your www subdomain as well.

    Redirect www


Configuring DNS Records

  1. Go to the DNS > Records menu, then click Add Record.

  2. 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.

    DNS Records


Testing Domain Redirection

  1. Wait for about 10 minutes, then test the redirection.
    You can use tools like What’s My DNS Redirect Checker.

    Testing Redirect


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. 😊