Skip to content

How to Redirect Domain on Cloudflare

Redirect Domain Cloudflare

Redirecting a domain is a crucial task for website owners, whether it’s for rebranding, merging websites, or improving user experience. Cloudflare offers a reliable way to manage domain redirections with its Page Rules and Transform Rules. In this case, we will only redirect the old domain to the new domain so that when we open the old domain, we will be automatically taken to the new domain. This guide will walk you through the process of setting up a domain redirect on Cloudflare while ensuring the best SEO practices.

Table of Contents

  1. Why do you need a redirect domain?
  2. Types of Domain Redirections
    • 301 Permanent Redirect
    • 302 Temporary Redirect
  3. Prerequisites for Setting Up a Redirect on Cloudflare
  4. Step-by-Step Guide to Redirect a Domain on Cloudflare
    • Adding Your Domain to Cloudflare
    • Configuring DNS Settings
    • Creating a Page Rule for Redirection
  5. Verifying the Redirection
  6. SEO Best Practices for Domain Redirection
  7. Common Issues and Troubleshooting
  8. Conclusion

1. Why do you need a redirect domain?

Domain redirection ensures users and search engines are directed to the correct website. It helps in cases such as:

  • Rebranding or changing a domain name
  • You have many similar domains and want to redirect to the main domain
  • Merging two websites
  • Avoiding duplicate content issues
  • Ensuring a consistent user experience

A proper redirection strategy prevents broken links and maintains your SEO rankings.

2. Types of Domain Redirections

There are two main types of redirects you can use on Cloudflare:

301 Permanent Redirect

This tells search engines that the page has permanently moved to a new location. It transfers SEO value to the new URL and is the best option for long-term changes.

302 Temporary Redirect

A 302 redirect is used when the redirection is temporary. It does not pass SEO authority to the new URL, making it ideal for A/B testing or short-term changes.

3. Prerequisites for Setting Up a Redirect on Cloudflare

Before setting up a redirect, ensure you have:

  • A Cloudflare account
  • Your domain added and configured on Cloudflare
  • Access to Cloudflare’s Page Rules (free users get three rules)

4. Step-by-Step Guide to Redirect a Domain on Cloudflare

Step 1: Adding Your Domain to Cloudflare

  1. Log in to your Cloudflare account.
  2. Click Add a Site and enter your domain name.
  3. Follow the on-screen instructions to update your nameservers to Cloudflare’s. This is the basic stage, most of this stage you have already done so you can simply go to stage 2.

Step 2: Configuring DNS Settings

  1. In Cloudflare’s DNS section, enter two A records with the IP provided by Cloudflare as follows (pxlib.com replace with your domain).
A Record Cloudflare
A Record Cloudflare
  1. Your domain should be proxied through Cloudflare (orange cloud enabled).

Step 3: Creating a Page Rule for Redirection

  1. Navigate to Rules > Overview in your Cloudflare dashboard.
  2. Click + Create Rule.
  3. Select Templates, and then select the “Redirect to a Different Domain” option. Click the “Create a Rule” button.
Create a Rule Cloudflare
Create a Rule Cloudflare
  1. Choose “Custom filter expression”. Fill in your old domain “yellow color”, then fill in your destination domain “green color”.
Redirect Domain Cloudflare
Redirect Domain Cloudflare
  1. Click Deploy to enable it.

5. Verifying the Redirection

After setting up the redirect, verify it using:

  • A browser: Enter the old URL and check if it redirects correctly.
  • Online redirect checkers like Redirect Checker or HTTP Status Code Checker.
  • Google Search Console: Monitor any changes in search indexing.

6. SEO Best Practices for Domain Redirection

  • Use 301 redirects for permanent moves to retain link equity.
  • Update internal links to reflect the new domain.
  • Submit a change of address request in Google Search Console.
  • Monitor traffic and rankings after implementing the redirect.

7. Common Issues and Troubleshooting

  • Redirect Loop: Ensure you are not creating conflicting rules.
  • DNS Not Updated: Verify your nameservers point to Cloudflare.
  • Slow Redirects: Use Page Rules instead of JavaScript-based redirects.

8. Conclusion

That’s a guide on how you can redirect the domain you want to a new domain using Cloudflare. There are many ways to redirect domains, and one of the fastest and most effective is at this level.

Maybe you like other interesting articles?

Leave a Reply

Your email address will not be published. Required fields are marked *