Are you tired of using your hosting and .htaccess for a simple redirection?

Do you want to redirect all your secondary domain names to one domain name?

Cloudflare is the leader CDN provider in the world with dozens of features allowing users to benefit from fast caching and providing the best browsing speed and experience to their users.

You can also use Cloudflare to redirect traffic using custom rules, without using your hosting and .htaccess which can be troublesome and time-consuming.

In this tutorial, you will learn the easy way to create a redirection from a domain name to another using Cloudflare Free plan.

Let’s dive in!

Redirect Traffic from a Domain to Another With Cloudflare

First, you need to create a new Cloudflare account from here.

Then after you log in to your dashboard, click on “Add a Site.”

Domain Name Redirect Redirection Without Hosting Web Cloudflare Cpanel Dns 1

Enter your domain name and click “Add site.”

Domain Name Redirect Redirection Without Hosting Web Cloudflare Cpanel Dns 2

Select the Free plan and click “Confirm plan.”

Domain Name Redirect Redirection Without Hosting Web Cloudflare Cpanel Dns 3

Add the Cloudflare’s DNS servers to your domain name’ admin panel. If you are using Godaddy you can find them under “Nameservers.”

Nameservers Dns Cloudflare Godaddy

Now add 2 records like this:

  • Type: A
  • Name: @
  • IPv4 address: 192.1.2.3 (use any IP, doesn’t matter)
Domain Name Redirect Redirection Without Hosting Web Cloudflare Cpanel Dns 4
  • Type: A
  • Name: www
  • IPv4 address: 192.1.2.3 (use any IP, doesn’t matter)
Domain Name Redirect Redirection Without Hosting Web Cloudflare Cpanel Dns 5

Click on “Continue.”

Domain Name Redirect Redirection Without Hosting Web Cloudflare Cpanel Dns 6

Open “Page Rules” from the menu on top. Click “Create Page Rule.”

Domain Name Redirect Redirection Without Hosting Web Cloudflare Cpanel Dns 7

Setup the page rules like this:

  • *mydomainname.com/*
  • Forwarding URL
  • 301 – Permanent Redirect
  • https://mynewdomainame/$2

Click on “Save and Deploy.”

Domain Name Redirect Redirection Without Hosting Web Cloudflare Cpanel Dns 8

You can turn this redirection any time or create 2 more rules if you want for free.

Domain Name Redirect Redirection Without Hosting Web Cloudflare Cpanel Dns 9

Now try to access your domain name in a few hours, you can flush the DNS cache on Windows using ipconfig /flushdns and try to open the site again, it should redirect successfully.

If you have any problems please leave a comment below!

Thank you and see you in the next tutorial on easytutorial.

Soufiane – Easytutorial.com