Easy Tech Tuts
Cloudflare

How to Set Up 301 Redirects Using Page Rules in Cloudflare Easily 2026

By Impran M N

Cloudflare offers two ways to forward URLs permanently: the legacy Page Rules interface and the newer Redirect Rules engine, and knowing which to use — and how to write the matching pattern — makes the difference between a clean redirect and a broken one. This guide covers both paths, including wildcard matching and preserving deep page paths during the forward.

01Set up a proxied placeholder record

Make sure the hostname you're redirecting has a proxied (orange cloud) DNS record, since Cloudflare's rules only apply to traffic passing through its edge.

02Choose your redirect method

Decide between a traditional Page Rule or the modern Single Redirect rule, both found under the Rules section of your dashboard.

03Build a Page Rule redirect

Create a Page Rule, enter your source URL pattern using wildcards where needed, and select the Forwarding URL setting for the action.

04Or build a Redirect Rule

Use the modern Redirect Rules expression builder to match incoming requests with custom filter expressions instead of simple wildcards.

05Map the destination with path variables

Use dynamic replacements like `${1}` in your destination URL to preserve the original page path when forwarding wildcard matches.

06Set the status code and deploy

Choose "301 – Permanent Redirect," decide whether to preserve the query string, then deploy and test the live links.

FAQ

Frequently asked questions

Should I use Page Rules or Redirect Rules?

Redirect Rules is the newer, more flexible engine and is generally recommended; Page Rules still works but is being phased toward legacy status.

Why isn't my redirect working even though the rule looks correct?

Check that the source DNS record is proxied (orange cloud) — Cloudflare rules only fire on traffic that passes through its network.

What's the difference between a 301 and a 302 redirect?

A 301 signals a permanent move and is best for SEO when a URL is changing for good; a 302 signals a temporary redirect.

Can I preserve query strings during a redirect?

Yes, both Page Rules and Redirect Rules include a toggle to preserve the original query string when forwarding.

Watch the full walkthrough

The same steps, demonstrated on screen from start to finish.