theasianpianist
theasianpianist

Reputation: 431

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.

Upvotes: 4

Views: 1947

Answers (3)

Max Ivanov
Max Ivanov

Reputation: 6581

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

Upvotes: 4

Barungi Stephen
Barungi Stephen

Reputation: 847

Set a forwading page rule 301 Redirect

from

http://domainA.com/*

to http://domainB.com/$1

Upvotes: 1

Darlan Dieterich
Darlan Dieterich

Reputation: 2537

In 6 steps you have new domain.

  1. In your control panel, select the domain
  2. Click on page rules
  3. In 'url match' set example: (domainA.com/*)
  4. Setting is 'forwarding url' with 302 (test) or 302 (production)
  5. And finnaly set the new url ex: (http://domainB.com)
  6. Save and deploy

for full documentation see this: https://support.cloudflare.com/hc/en-us/articles/200172286-Configuring-URL-forwarding-or-redirects-with-Cloudflare-Page-Rules

Upvotes: 0

Related Questions