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.
Your redirect rule
Dashboard: your domain → Rules → Overview → Create rule → Redirect Rule. Fill the fields like this:
- Rule name
- When incoming requests match
- Custom filter expression, then Edit expression:
- Then: URL redirect
- Type:
- Status code
- Preserve query string
The same rule for the API
A rule object for POST /zones/{zone_id}/rulesets/{ruleset_id}/rules (the zone’s http_request_dynamic_redirect ruleset). A token needs the zone permission Single Redirect: Edit.
Try a URL
Worked out in your browser from Cloudflare’s documented behaviour. Check the real thing with curl -sI once the rule is live.
Dashboard (account level): Bulk Redirects → create a Bulk Redirect List → upload this CSV → then create a Bulk Redirect Rule that uses the list. The old hostnames must be proxied (orange cloud).
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()andwildcard_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.hostcovers http and https in one rule, so a visitor onhttp://example.comreaches 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.