Cloudflare Domain Forwarding: A Step-by-Step Guide

Author

Reads 1K

Circuit board close-up

Cloudflare Domain Forwarding is a powerful tool that allows you to redirect visitors from one domain to another, masking the original URL and improving user experience.

With Cloudflare Domain Forwarding, you can forward your domain to any other domain, including subdomains, without changing the URL in the browser's address bar.

This means that users will still see the original URL, while being redirected to the new domain.

Setting Up

To set up Cloudflare domain forwarding, you'll need to start by signing up for a Cloudflare account and adding your domain. You can do this by providing your email and setting up a password, and then specifying the domain you want to redirect.

You'll then need to choose a plan, and for redirecting a domain, the free plan is suitable. After successful verification, a caution message will appear on the Cloudflare dashboard homepage indicating that your site is being safeguarded.

Credit: youtube.com, How to CORRECTLY Forward or Redirect Domains in Cloudflare [2024]

Once you've added your domain, you can configure the DNS settings by examining and modifying the DNS records of the domain. This includes deleting any existing records and setting up essential inputs required for Cloudflare functionality, such as a single DNS entry directing to any IP address.

Here's a step-by-step guide to setting up the DNS settings:

After setting up the DNS settings, you can update the nameservers to direct your domain to Cloudflare servers. This involves logging in to your domain registrar's control panel and updating the nameservers with the ones specified in your Cloudflare dashboard.

Sign Up & Notify

Sign up for CloudFlare by providing your email and setting up a password if you're new to the platform.

Existing users can add a site by clicking on the ” + Add site” option displayed on the dashboard pages.

You'll need to specify the domain where you want to set up the redirect in CloudFlare.

Choose the free plan for redirecting a domain in CloudFlare, which can also be suitable for improving website performance.

Upon successful verification of the modification, a caution message will appear on the CloudFlare dashboard homepage indicating that your site is being safeguarded.

Configure DNS Settings

Credit: youtube.com, DNS Configuration - CompTIA A+ 220-1101 - 2.6

Configure DNS Settings is a crucial step in setting up CloudFlare. You need to manage the domain you want to redirect on Cloudflare.

First, you'll need to add DNS settings to point the root (@) and www of the domain to a dummy domain, such as 192.1.2.3. It's essential to set the proxy status to Proxied.

To configure the domain's DNS settings, CloudFlare scans the domain to find existing records in the DNS zone. The scan results are displayed on the screen, and you'll need to remove current entries carefully, as deleting them can affect configured services.

A single DNS entry directing to any IP address is required to set up a redirect without a hosting server. You can use a reserved IP, such as 192.0.2.0, for this purpose. To add this entry, choose type A in the first field, input an @ in the Name field, provide the reserved IP in the IPv4 address field, set TTL to "Auto", and select "With proxy" for the status.

For another approach, see: Url Forwarding Cloudflare

Credit: youtube.com, How to configure DNS Server | Step by step DNS server configuration

You'll also need to add an entry for the "www" version of your domain, keeping the other fields the same. It's crucial that both entries are set to "With proxy" under the "Pro proxy status" option for the redirection to function.

Here's a summary of the DNS settings you'll need to add:

After adding these entries, you'll need to update the nameservers for your domain. CloudFlare will provide instructions on how to do this, and you'll need to log in to your domain registrar's control panel to update the nameservers with the ones specified in your CloudFlare dashboard.

Redirect Rules

Redirect Rules are a crucial part of Cloudflare domain forwarding. To configure URL forwarding or redirects using Page Rules, log in to your Cloudflare account and select your account and domain. Go to Rules > Page Rules, and under Page Rules, select Create Page Rule.

To set up a redirect, you need to specify the URL or URL pattern that should match the rule. This can be done by entering the old domain, followed by /*, which will impact all URLs of the domain. Select "Forwarding URL" from the "Pick a Setting" drop-down menu, and choose between "301 - Permanent Redirect" or "302 - Temporary Redirect".

Here are some examples of redirects that can be set up using Cloudflare Page Rules:

Remember to create two separate rules for the WWW version and the non-WWW version of your Old Domain to successfully cover both versions.

Why Redirect?

Credit: youtube.com, Mastering URL Redirect Management: Expert Insights and Best Practices

Redirecting your domain is a game-changer for your online presence. CloudFlare is a popular choice for this purpose, offering free, flexible, and effective services that can combat spam on websites.

Before CloudFlare, you needed a website hosting service to perform redirects, but often it wasn't worth hiring a service solely for that purpose. This is because registering a domain alone doesn't include a web server, and thus, doesn't automatically enable redirect configuration.

CloudFlare provides valuable free services like domain and page redirection without any set limit on the number of domains you can have on their free plan. This makes it a helpful tool for improving the internet.

Some domain registration companies offer more than just registration services by providing free domain redirection, but these services may have limitations. For example, Registry.br only offers redirection for national domains ending in .br without advanced DNS configuration options.

Intriguing read: Azure Domain Services

Define Redirect Rules

To define redirect rules, you need to log in to your Cloudflare account and select your account and domain. Go to Rules > Page Rules and select Create Page Rule.

For your interest: Hover Domain Parked Page

Credit: youtube.com, Vertex Forge | Components 101 - Redirect Rule

The first step is to enter the URL or URL pattern that should match the rule. This can be a specific URL, such as old-domain.com, or a pattern, like *old-domain.com. The asterisk (*) is a wildcard character that represents any other character in any quantity.

You can use the asterisk to capture any value in a specific part of the address. For example, if you want to redirect old-domain.com/page-anyone to new-domain.com/page-anyone, you can input old-domain.com in the first field and https://new-domain.com/$2 in the second field, with $2 capturing any data within the second asterisk.

To redirect all traffic to the primary domain, you can use the /* character at the end of the URL pattern. This will impact all URLs of the domain, such as /members, /join, and all others.

Here are some examples of redirect rules:

  • 301 - Permanent Redirect: Redirects the user to a new URL, but keeps the original URL in the browser's address bar.
  • 302 - Temporary Redirect: Redirects the user to a new URL, but changes the original URL in the browser's address bar.

You can choose between these two options when setting up your redirect rule.

To set up a basic redirect on Cloudflare, you need to follow these steps:

Explore further: Cname Url Redirect

Credit: youtube.com, 301 Redirects Explained In Under 4 Minutes | Help Your Site's SEO!

1. Input the standard *dominio.com*, substituting dominio.com with your domain.

2. Select the “guiding URL” or “URL Forwarding” option in the settings.

3. Choose between a 301 permanent redirect or a 302 temporary redirect.

4. Specify the destination address for redirecting your domain.

By following these steps, you can create a redirect rule that captures any value in a specific part of the address and redirects it to a new URL.

Advanced Options

Using advanced forwarding options with Cloudflare can help you preserve the URL structure of your website. By using variables, you can reference specific parts of the URL in the forwarding address.

A basic redirect can lose the URL structure, sending users to a generic page instead of the intended one. For example, if you forward example.com to www.example.com, users who visit example.com/some-particular-page.html will be redirected to www.example.com instead of www.example.com/some-particular-page.html.

You can use variables to capture specific parts of the URL and include them in the forwarding address. Each wildcard corresponds to a variable, represented by a $ (dollar sign) followed by a number. To refer to the first wildcard, you would use $1, the second wildcard $2, and so on.

Using variables can help you preserve the URL structure and provide a more accurate forwarding experience for your users. For instance, if you use the pattern example.com/* and set up the forwarding address to www.example.com/$1, users who visit example.com/some-particular-page.html will be redirected to www.example.com/some-particular-page.html.

Step-by-Step Instructions

Credit: youtube.com, How-to: Redirect Domains in Cloudflare [2025]

To set up Cloudflare domain forwarding, you'll need to create two "A" records. Once you have those in place, it's time to create a dynamic redirect.

Scroll down to the "When incoming request match" section and click on the "All incoming" option. Under the "URL Redirect" section, make the following changes: type should be set to "Static" and the status code should be 301 (Permanent Redirect).

Recommended read: Domain Url Redirect

Set Up Page Rules

To set up page rules, log in to your Cloudflare account and select your account and domain. Then, go to Rules > Page Rules and select Create Page Rule. Under If the URL matches, enter the URL or URL pattern that should match the rule.

You can use the asterisk (/*) character to impact all URLs of the domain, such as /members, /join, and all others. For example, if you enter old-domain.com/*, the rule will apply to all URLs on the old domain.

Credit: youtube.com, Cloudflare Redirects: How to Setup 301 Redirects (URL Forwarding) Using Page Rules

To forward the browser to the new target, select Forwarding URL from the drop-down menu and choose between 301 - Permanent Redirect or 302 - Temporary Redirect. The vast majority of users will want to select the 301 - Permanent Redirect option.

To cover both the www version and the non-www version of your Old Domain, create two separate rules - the WWW version and the non-WWW version. This will ensure that users visiting www addresses or www addresses will be impacted by the rule.

Here's a summary of the steps to set up page rules:

By following these steps, you'll be able to set up page rules and forward your domain to a new target.

Scenario

Let's assume you want to redirect from old-domain.com to new-domain.com. This is a common scenario where you want to point your old domain to a new one.

You can use Cloudflare domain forwarding to achieve this. Cloudflare is a popular service that helps you manage your domain and its traffic.

Credit: youtube.com, How to Redirect Domain to Another with Cloudflare

To start, you'll need to set up Cloudflare with your old domain, old-domain.com. This will involve adding the domain to your Cloudflare account and configuring the DNS settings.

Once you've set up Cloudflare with your old domain, you can create a forwarder to direct traffic to your new domain, new-domain.com. This is a straightforward process in Cloudflare's dashboard.

URL Redirection

URL Redirection is a crucial aspect of Cloudflare domain forwarding. You can configure URL forwarding or redirects using Cloudflare's Page Rules tool.

To set up URL redirection, log in to your Cloudflare account and select your account and domain. Then, go to Rules > Page Rules and select Create Page Rule. Under If the URL matches, enter the URL or URL pattern that should match the rule.

Using the asterisk (*) character in the URL pattern will impact all URLs of the domain. For example, entering olddomain.com/* will redirect all URLs of the old domain to the new domain.

Credit: youtube.com, How to Redirect a URL Using Cloudflare (2025) | Simple 301 Redirection Tutorial

You can choose between 301 - Permanent Redirect and 302 - Temporary Redirect. The vast majority of users will want to select the 301 - Permanent Redirect option. This will inform search engines that the URL change is permanent.

To redirect the www version and non-www version of your old domain, create two separate rules. The first rule will redirect the www version, and the second rule will redirect the non-www version.

Here's an example of how to set up the rules:

By using the $1 variable, you can capture any value in the URL and redirect it to the new domain. This is especially useful for preserving add-ons and parameters in the URL.

For example, redirecting www.dominioA.com/page-anyone to www.dominioB.com/page-anyone can be achieved by inputting dominioA.com in the first field and https://www.dominioB.com/$2 in the second field.

Leslie Larkin

Senior Writer

Leslie Larkin is a seasoned writer with a passion for crafting engaging content that informs and inspires her audience. With a keen eye for detail and a knack for storytelling, she has established herself as a trusted voice in the digital marketing space. Her expertise has been featured in various articles, including "Virginia Digital Marketing Experts," a series that showcases the latest trends and strategies in online marketing.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.