Skip to content
Rankora
Free · runs in your browser

Cloudflare Redirect Rule Generator

Cloudflare offers two ways to redirect: one rule per redirect (Single Redirects) or a list of exact URLs (Bulk Redirects). The tool writes both, plus a few common presets.

Privacy and cost

This tool runs in your browser. What you type or paste is not sent to our servers and it costs nothing to use.

How it works

  1. Paste the list and enter your domain, or choose a preset (apex to www, www to apex, HTTP to HTTPS, domain move).
  2. Single Redirects tab: copy the expression and the destination URL into the rule; the JSON is for the API. Bulk tab: download the CSV or copy the JSON items.
  3. Check the rule in the Cloudflare dashboard preview before enabling it, then test the URL.

Example

For "/old-page /new-page" with the domain example.com, the expression is (http.request.uri.path in {"/old-page" "/old-page/"}) and the destination is https://example.com/new-page with a 301. The apex to www preset gives (http.host eq "example.com") with concat("https://www.example.com", http.request.uri.path).

What the result means

Single Redirects filters on fields (http.host, http.request.uri.path, http.request.uri.query) and can build the destination with functions such as concat() or wildcard_replace(). Bulk Redirects matches the full URL exactly, with no regex, so every variant is its own row. Rules only run for hostnames proxied through Cloudflare (orange cloud). The tool cannot know your plan limits or test your rules.

Common problems this tool helps with

  • A DNS record that is not proxied (grey cloud) ignores Cloudflare rules.
  • A PUT on the phase entrypoint through the API replaces every existing redirect rule in the zone.
  • A hand-written HTTP to HTTPS redirect can loop: the Always Use HTTPS setting is often simpler.
  • The number of Single Redirects is limited per plan; long lists belong in Bulk Redirects.

Frequently asked questions

Single Redirects or Bulk Redirects?

Single Redirects suits a handful of rules with conditions (host, folder, query string). Bulk Redirects suits long lists of exact URLs. One rule enabled on the list then applies every row.

What does wildcard_replace do in the target?

Cloudflare swaps the * of the source into ${1} in the destination. That is how a folder /blog/* becomes /articles/* while keeping the rest of the path.

Is the CSV guaranteed to be accepted?

No. The column order follows the Bulk Redirects documentation at the time of writing, but Cloudflare can change it: compare with its current documentation before importing.

Is my data sent anywhere?

No, everything is generated in your browser.