Cloudflare Redirect Rule Generator

This site sends trickspanda.com to www.trickspanda.com with one Cloudflare redirect rule (I wrote about it in redirecting non-www to www in one hop). The rule is short, but the dashboard wants a filter expression and a dynamic target in Cloudflare’s rules language, and one wrong quote or bracket is enough to break it.

So I put the common cases into a small generator. Pick what you want to redirect and copy the fields exactly as the dashboard asks for them, or the same rule as API JSON. For a list of old and new URLs, it builds a Bulk Redirects CSV instead. Every rule uses only functions that work on the free plan.

Everything runs in your browser: nothing you type is sent anywhere.

What do you want to redirect?

Without www. The rule goes in this domain’s Cloudflare zone.

The rule goes in the old domain’s zone, so the old domain has to stay on Cloudflare.

The rule only matches this hostname. Leave empty to match every hostname in the zone.

A full URL, or a path on the hostname above.

/blog/a/b → /news/a/b. A path stays on the hostname above.

Separate them with a space, a tab, a comma or ->. You can paste two columns from a spreadsheet.

Bulk options
Query string

What this does, and its limits
  • Single Redirects (Redirect Rules in the dashboard) run on every plan: 10 rules on Free, 25 on Pro, 50 on Business, 300 on Enterprise. The rules here use only http.host, http.request.uri.path, concat(), starts_with() and wildcard_replace(), so they work on Free; regular expressions need Business.
  • Redirects only run on proxied (orange cloud) DNS records. The bare-domain and www records both need one.
  • Matching on http.host covers http and https in one rule, so a visitor on http://example.com reaches the final URL in one hop. Cloudflare’s own www templates match https only.
  • Make the target match your CMS’s canonical address (in WordPress, the Site Address). If the rule and WordPress disagree, you get a redirect loop.
  • Path matches are case-sensitive and use the path as the browser sends it (spaces as %20).
  • The folder rule matches paths that start with the folder (/blog/…), not the folder without its slash (/blog). Add a second “one page” rule for that if you need it.
  • Bulk Redirects: Free accounts get 10,000 URL redirects across 5 lists. Source URLs can’t contain a query string; requests match whatever their query string is. The CSV has no header row, as Cloudflare requires.
  • Every expression this page builds was run through Cloudflare’s expression validator on 27 November 2026, and the bare-domain-to-www rule is the one trickspanda.com runs. The “Try a URL” result is worked out from Cloudflare’s documentation, not by Cloudflare.

How I tested it

  • The bare domain to www rule it builds is character for character the rule that runs on trickspanda.com.
  • I sent every expression it builds to Cloudflare’s own expression validator: 12 of 12 were accepted, and the 4 broken ones I added on purpose were rejected.
  • The Bulk Redirects CSV was checked against Cloudflare’s documented format with a messy list (duplicates, loops, query strings, commas inside URLs).

Limitations

  • Only the bare domain to www rule has run on a real Cloudflare zone. The other rule types passed Cloudflare’s validator, but I haven’t run them live.
  • The validator checks the syntax, not your plan’s limits (the free plan allows 10 redirect rules).
  • The folder rule doesn’t catch the folder without its trailing slash (/blog). The tool reminds you about it.