Dynamic Redirect of Old Domain to New Domain in Cloudflare

⚠️ NOTE ⚠️

This was originally written for those wanting to change their domain name in Kajabi. However, this will work for any platform. Depending on the situation though, some additional Page Rules in Cloudflare may be needed (for example, if you had your checkout cart on a subdomain and your website on your root domain).

Point is: where there’s a will, there’s (usually) a way!

Feel free to reach out.


First and foremost, both of your domains (the old and the new) need to be added to a free Cloudflare account. You'll need to have this done first (it involves changing your nameservers at your domain registrar). If this is beyond the scope of your knowledge, again, feel free to reach out.

After you have the new domain set up in Kajabi, and BOTH domains are in the same Cloudflare account, follow these steps (and wait 10 minutes after you finish it to test things):

1.) In the OLD domain, go to "Rules > Page Rules" in the Cloudflare menu.

2.) Delete any old Rules in the old domain there. They aren't needed any longer.

3.) Still in the OLD domain, create a new “Rule” with the following settings (replacing "old-domain" and "new-domain" with your own domains):

  • theolddomain.com/*
  • Choose "Forwarding URL"
  • Status Code: 301 - Permanent Redirect
  • Destination: https://www.thenewdomain.com/$1

4.) Create a second “Rule” with the following settings (replacing "old-domain" and "new-domain" with your own domains):

  • www.theolddomain.com/*
  • Choose "Forwarding URL"
  • Status Code: 301 - Permanent Redirect
  • Destination: https://www.thenewdomain.com/$1

Once you do that, ALL old URLs from your old domain will automatically redirect to the exact same URLs on the new domain.

MAGIC! 🪄 🤩

 

Stay connected with news and updates!

Join my mailing list to receive the latest news and updates.

We hate SPAM. We will never sell your information, for any reason.