Set Up a 301 Redirect Through Cloudflare, Step by Step

Moving to a better domain name? Here's how to set up a 301 redirect with Cloudflare so your old links, search ranking, and customers all land on the new name.

PixelWorks Domains Team··4 min read

Say you bought a shorter, easier-to-say domain for your business. Smart move. But now you have a problem: people still have your old address saved. It's on business cards, old invoices, your Google listing, and plenty of links around the web. If you just switch sites, all of that breaks.

A 301 redirect fixes it. A 301 tells browsers and Google, "This address moved for good. Send everyone to the new one." Done right, your old links keep working and the ranking you earned follows you to the new name.

This guide shows you how to set up a 301 redirect with Cloudflare. It's free, it's reliable, and you don't need to be technical to follow along. Give yourself about 30 minutes the first time.

Why Cloudflare for this

There are a few ways to redirect a domain. Some registrars offer simple forwarding, but it can be slow or drop parts of the web address. Cloudflare sits in front of your domain and handles the redirect fast and cleanly. It also lets you keep every old page pointed at its matching new page, which protects more of your search ranking than dumping everyone on the homepage.

If you want the reasoning behind that last point, read Redirect to Homepage or Matching Page? Where 301s Preserve the Most Authority. It's worth two minutes before you build this.

What you need before you start

  • Your old domain (the one you're moving away from).
  • Your new domain and a working site on it.
  • Access to the account where your old domain is registered, so you can change its name servers.
  • A free Cloudflare account.

One thing to be clear on: you're adding the old domain to Cloudflare, not the new one. The old domain is the one doing the redirecting.

Step by step: set up a 301 redirect with Cloudflare

1. Add your old domain to Cloudflare

Sign up at Cloudflare and choose "Add a site." Enter your old domain. Pick the free plan. Cloudflare will scan your existing DNS records and show you a list. You can leave these as-is for now.

2. Point the old domain's name servers to Cloudflare

Cloudflare will give you two name server addresses. Go to wherever your old domain is registered, find the name server settings, and replace what's there with Cloudflare's two. Save it.

This change isn't instant. It usually takes a few minutes to a few hours to go live, sometimes longer. Cloudflare will email you when your domain is active. For the exact steps at your registrar, Cloudflare keeps a clear help page here: https://developers.cloudflare.com/dns/zone-setups/full-setup/setup/.

3. Make sure the old domain has a DNS record to catch traffic

A redirect needs something to grab the request before it can send it on. In Cloudflare's DNS tab, make sure you have an A record for your old domain. A common approach is to point it at a placeholder IP like 192.0.2.1 and turn on the orange cloud (proxied). The orange cloud is what lets Cloudflare step in and do the redirect. Add the same record for the www version too.

4. Create the redirect rule

In your old domain's dashboard, go to Rules, then Redirect Rules, and create a new rule. Here's a simple setup that keeps each old page pointed at its matching new page:

  • When incoming requests match: choose "All incoming requests," or match by hostname if you want to be specific.
  • Then: choose a Dynamic redirect.
  • Expression: use concat("https://www.yournewdomain.com", http.request.uri.path). This carries the page path over, so oldsite.com/services lands on newsite.com/services.
  • Status code: choose 301. This is the part that makes it permanent. A 302 is temporary and does not move your ranking the same way.

Save and deploy. The difference between those two codes matters more than it sounds. See 301 vs 302 Redirects: Which One Protects Domain Authority? if you want the short version.

5. Test it

Open a browser and type your old domain. You should land on the new one. Now test a deeper page, like oldsite.com/about, and confirm it goes to newsite.com/about. Try the www and non-www versions both. Fix the rule if anything lands in the wrong place.

Common mistakes to avoid

Two problems trip people up most. First, redirecting everything to the homepage instead of the matching page. That throws away ranking you could have kept. Second, stacking redirects so a request bounces through two or three hops before it lands. That's slow and it leaks value. Our guide Redirect Chains and Loops: How They Quietly Leak Domain Authority shows how to spot both.

For a fuller checklist before you go live, 7 Common 301 Redirect Mistakes That Kill Domain Authority is worth a read. And if you'd rather do this at the registrar or host level instead of Cloudflare, How to 301 Redirect an Old Domain to Preserve Its Authority walks through the other options.


Setting up the redirect is the technical half of moving to a better name. The other half is picking a name worth moving to in the first place. If you're still weighing that, browse names for your city and trade on PixelWorks Domains, or ask us about one specific domain you have in mind. Either takes under a minute.

More in Domain SEO & Authority: Turning a Name Into Market Advantage

View the full topic →

How Long Should You Keep Paying for the Old Domain?

You moved your website to a better domain name and set up a 301 redirect. So how long do you keep renewing the old one? A plain answer for small business owners.

Nov 19, 2026

Mapping Old Pages to New URLs So No 301 Dead-Ends

Moving to a better domain? Don't send every old page to your new homepage. Here's how to map old URLs to new pages during a 301 redirect so nobody hits a dead end.

Nov 12, 2026

Renamed Your Business? How to 301 the Old Name to the New One

You changed your business name and got a better domain. Here's how to point the old one at the new one so you don't lose the customers and Google rankings you already earned.

Nov 5, 2026

Will My Google Rankings Drop After I 301 to a Better Name?

Worried a better domain name will cost you your Google rankings? Here's what a 301 redirect really does, what usually happens after a move, and how to keep the search traffic you've earned.

Oct 29, 2026

Continue reading

Fix the Links Inside Your Site After You Switch Domains

After you move to a better domain, the menus, buttons, and page links inside your own site can still point at the old name. Here's how to find and fix them.

Nov 26, 2026

Is There a Bad Time of Year to Move Your Site to a New Domain?

Google doesn't read a calendar, but your business does. Here's the best time to change your domain name without hurting rankings — and the weeks to avoid.

Nov 26, 2026

Landscaper and Lawn Care Domains: Add the City or Not?

Should your landscaping or lawn care domain name include your city? Here's a plain guide to deciding, with real examples for crews that work one town or a whole metro.

Nov 26, 2026

Sounds Right, Spelled Wrong: Homophones That Hide Your Website

Some domain names sound perfect out loud but get typed wrong every time. Here's how a homophone in your domain name sends customers to a blank page — and what to do about it.

Nov 26, 2026

Featured domains

atlantaclicks.com
AtlantaClicks.com
$2,999
texasmissions.com
Texas Missions
$7,888
atlantatrafficticket.com
Atlanta Traffic Ticket
$3,488
atlantaluxurybroker.com
Atlanta Luxury Broker
$2,999
Browse all domains →