Redirecting One Domain to Another

This tutorial covers redirecting one domain to another. For this, we will be redirecting domainA.com to domainB.com.


The following settings need to be configured under the domain you are redirecting from, in this example, this is domainA.com

Step 1, The DNS Record:
The first thing you will need is a DNS record for @, www and any other subdomains you want to redirect, set to :orange:. This can point to any IP address as the redirection page rule will execute first. I would recommend pointing them to 192.0.2.1 , a dummy IP.


Step 2, The Page Rule:
The second step is the page rule that will perform the redirect. You should add one like this:

This page rule will redirect as per the following examples:

domainA.com > https://domainB.com
www.domainA.com > https://domainB.com
domainA.com/page > https://domainB.com/page
www.domainA.com/page > https://domainB.com/page

Should the domain you are redirecting to be served on www, you can add www to the URL at the bottom of the page rule.

Introduction to redirecting with page rules video



Tutorial Reference: CT-29

Reviewed: 08/21

This is a Community Tutorial, most are wiki posts, so can be contributed to by Regulars and MVPs here. If there is a tutorial you would like to see, you can request one here.

If you would like to provide any feedback on this tutorial, please post in the #Meta category, tag your post #TutorialFeedback and let us know the Tutorial Reference above.

Other great resources on this community include the Community Tips . These address best practices when configuring Cloudflare, how to fix issues you may see, and tools to troubleshoot. Also you can view Expert Tips, great posts on the community from people in the know that may help you with your issue.

We encourage users to check out these great resources and the Cloudflare Support Centre before posting


28 Likes
URL Redirection to an outside domain
Redirect doesn't work
301 redirect not working
Url forward and www
Community Tutorials
Forward Only Domain
Whole domain forwarding
Can't reach domain
Redirect page rule for http, https, non-www, www
How do I redirect one of my domains to another one without affecting the subdmain
NOB needs HELP with 301 redirect :)
In order to create a subdomain (Page Rule) redirect, what DNS record should I use?
Old Domain URL to New Domain URL (cloudflare page rule)
Rules Page
Redirect to other web
Domain to new domain
Page Rule does not work
Page Redirect not working
Escape at symbol in CNAME target
Page Rule, Forwarding URL: Appropriate DNS Settings?
Redirecting my domain to another domain not working
Unable to create CNAME Record (Error Code: 1004)
Webhop & CName
Multiple domains to same website?
New onset error 521 w/ custom domain to Tutanota mail login
How to direct my domain to a particular website
Cloudfire isnt redirected to another domain
Page Rule Redirect DNS Not Resolving
Cloudflare does not auto add DNS records
Redirect one site to another Site With Slug
Redirecting expired domain
How to redirect and domain .com to a .com.br domain?
DNS record setting
2 Domains in cloudflare
Transferred my domain from Google to Cloudflare. :grimacing: And broke everything
Redirects were removed from DNS
Redirecting All traffic to Another Domain
Redirection problem
Redirect Website at DNS level without redirecting mail (MX records)
How to config dns to connect free domain .tk to home server (Raspberry)
How to use Page Rules
Attempting to add a Dummy IP for CNAME
2 separate domain names pointing to one host IP
Forward domain to another domain - do I need to change Nameserver
Can't seem to forward properly
How to create a redirect, that works with HTTPS?
Newbie Question
Redirect rule not working
Domain redirecting Help without Pointing to an IP
Mask a subdomain under 'www'
How to forward hostname when using CNAME?
Cloudflare settings when cloudflare is the registrar
Forwarding URL page rule not working
I have only domain which IP address I will use for record A&AAAA. how I rout to mail hosting server login pag e
Hosting needs for pagerule 301
I want naked and www to point to a google business site?
Redirecionar pra página do favebook
How to add a subdomain
Change to another domain name but keeping old domain name
How do I redirect with no DNS records?
Forwarding an old domain name to a new domain name and IP address
Hi,I need to redirect site a site to a non Cloudflare site
GitHub Subdomain
DNS for redirect
Page Rule-Permanent Redirect
Setting up cname
Adding new domain as primary domain but keeping old domain as additional domain
Do i need to add any DNS record if i am using the domain just for URL forwarding
Using page rules to perform redirects
How to link cloudflare wordpress plugin with subdomain
Domain forward to a specific page on another domain
Domain Name and Redirects
How to change google suite services address
Cpanel redirects
Mystery: Intermittent "err connection refused" on 301 redirect to my domain
Creating subdomain
Total newbie needs assistance with redirect from owned domain to a DDNS domain
Pointing one domain to another
Url Won't Direct to Facebook Group
Redirect www-domain to another domain
Domain Redirect
Create a serverless redirect domain?
Cloudeflare is not working propely
URL forwarding not working with Rules
301 Redirect Issue
Can't make domain forwarding work with page rules
.fun domains not URL forwarding?
Web redirection from domain A to domain B
Root domain forward
I see this error ERR_NAME_NOT_RESOLVED every time I visit my site
Error 522 on Forwarding URL
Domain to domain redirection
My DNS not working -- younoob.tv
Website need to go to my Facebook Page
HTTPS doesn't work
HTTPS doesn't work
Can cloudflare map a subfolder to another website or domain
Transfer website settings and repoint original domain
Redirecting DNS to Third Party URL
How to point a sub-domain in one domain to a different domain?
SSL is not available and forwarding problems
No encuentro mi dominio
Redirect or Forward a CloudFlare Purchased domain to a subdomain
How do I find A host number for a site
Register365.com rejecting Cloudflare nameservers
Multiple Domains with Identical Forwarding and DNS but Two Domains Return 522: Connection timed out errors
Redirect Issues
Nameservers Not Working
Nameservers Not Working
How to redirect main domain
Same DNS on two domains only resolves one domain
Externally Hosted Domain 301 Redirect to Cloudflare Domain
Redirect 1 site to a different site
How to resolve root domain with no server
I need help With url directing
Page Rule - Redirect rule isn't working
I want to migrate domain forwarding from another cloudflare account.
Redirect not working for multiple domains
*. Domaina.co.uk/* to *. Domainb/* redirect
Forwarding Issue
Website won't load
Tutorial CT-29 "Redirecting One Domain to Another" doesn't work anymore
Redirect a domain from Cloudflare to a subdomain
Purchased domain on godaddy
Nameservers working, but A records are not correct
DNS setting for pointing domain name to main website
One page rule for http, https, http://www, https://www to forward to another URL
Domain Redirect Not Switching Back
Redirect Domain
DNS and page rules only
301 redirect help
Is it possible to have positive SSL certificates for redirected domains?
Redirect http x domain to https y domain
Can't get Forwarding to work with & without www & https
Domains/Page Rules
Forward/Redirect to another domain name
Redirect 301
NS point to CF but I can't see my site on CF
URL Redirection
What CName do I use for forwarding?
A Name Not Redirecting to IP
Redirect root and www only - keeping subdomains
Page rule forwarding of non-existent subdomain
DNS Alias Forwarding
I need a webhost to redirect my site to facebook?
How redirect domain to webpage on other domain?
Setting up both www.example.com and example.com to forward to same doamin
Redirect My Website To another domain URL
Redirect My Website To another domain URL
URL Forwarding: non-unique match wildcard redirect
Best way to do a redirect to another domain (both on Cloudflare)
Use Page Rules but I don't have actual web site for root domain
Configure Domain To Target Subfolder In Another Domain
Two domains one server Cloudflare configuration
URL Forward Page Rule Not Working
Web Forwarding for anything.thisdomain.net
Domain name forwarding
301 redirect not working on https but will on http
If I am not in the cloudfare network can I redirect my domain to a cloudfare network domain
Can't do 301 Redirect Properly using Page Rules, Please Help
Add a Addon domain
Redirect all pages to other domain
I own 2 domains and I would like to redirect the 2nd to my main domain
Why won't this URL redirect work?
URL Redirection to an outside domain
Redirect a .co.uk domain to .com site
I have a new domain. i want to point it to my old domian. both are now in cloudfare. how do i solve the problem on the photo?
Should I add Cloudfare to my Alias domain
My domain direct to smugmug doesn`t work
URL Redirection Failed