How to redirect one domain to another with Cloudflare
February 12, 2022
You can redirect one domain entirely to another domain using Cloudflare.
First, add an A
record in Cloudflare that points the root of the domain (@
) to 192.0.2.1
, which is a dummy IP address. We donât actually care what IP address itâs pointed to, since weâre gonna be redirecting away anyway. The important part is that Proxied is turned on, so that Cloudflare can sit in front of the domain and redirect it before we actually get to the IP address.

ben.cv
. Next, go to Rules in the left sidebar and create a new Page Rule for this domain.
For the URL, put in from.com/*
, where from.com
is the domain you want to redirect away from. Then, set it to âForwarding URLâ with a 301 redirect.
In the destination field, put to.com/$1
, where to.com
is the domain you want to redirect to.

ben.cv
and all of its sub-paths to benborgers.com
.This will redirect all pages on the domain. For example:
from.com
âto.com
from.com/something
âto.com/something
from.com/something/else
âto.com/something/else
Subscribe to my newsletter!
A weekly round-up of new blog posts and updates to projects Iâm working on.