Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudflare redirect domain

I'm trying to redirect domainA.com to domainB.com. Both domains are managed with Cloudflare. I've tried using Page Rules for domainA to redirect all requests to domainB.com. However, I've also read that domainA needs to have DNS records of some sort through Cloudflare but I'm not entirely sure how to configure these? This redirect is the only thing I'm using domainA for, there's no content hosted on it at all.

like image 502
theasianpianist Avatar asked Oct 21 '25 16:10

theasianpianist


1 Answers

A combination of a mock CNAME record and a Page Rule will make it.

  1. Go to your source domain's DNS settings page.

  2. Create a CNAME record for the @ (root domain). Point it to some subdomain, it doesn't have to exist as the page rule will kick in before the DNS record resolves.

enter image description here

  1. Go to your source domain's Page Rules page.

  2. Create a new page rule redirecting all requests to your domain as necessary (choose 301/302 - whichever makes sense in your case).

enter image description here


  1. Give it some time and confirm https://source-domain.com redirects to https://target-domain.com.

Repeat steps 1 - 5 for the www subdomain if you want www.source-domain.com to redirect too (which is often the case).

like image 118
Max Ivanov Avatar answered Oct 24 '25 10:10

Max Ivanov