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
- Paste the list and enter your domain, or choose a preset (apex to www, www to apex, HTTP to HTTPS, domain move).
- 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.
- 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.
Related tools
- Redirect Rule GeneratorOne list, six output formats. The tool checks every line, flags loops, duplicates and chains, then writes the syntax each platform expects.Free · runs in your browser
- Apache .htaccess Redirect GeneratorThree modes: page-by-page redirects, site hygiene (HTTPS, www, trailing slash) and a move to a new domain. Patterns are escaped for you.Free · runs in your browser
- Nginx Redirect GeneratorFor a long list the tool writes a map table (hash lookup, no regex); for a few pages, location blocks. It also writes the server blocks for HTTPS, www and domain moves.Free · runs in your browser
- Redirect Chain CheckerPaste a URL to see every redirect it goes through before the final page, with the status code and timing of each hop.Free account · 3 live checks/day
- Canonical Tag GeneratorPaste a page URL: the tool cleans it (https, tracking parameters, fragment, index file, trailing slash) and outputs the canonical tag and the HTTP header.Free · runs in your browser
- URL ParserPaste a URL to see each of its components and a decoded table of its query parameters, plus the details that matter for SEO.Free · runs in your browser