Redirect Rules

How to create rules, match URL patterns, and bulk import via CSV.

Rule types

Every rule maps an incoming path on your domain to a destination URL. Rules are matched in priority order: exact match first, then wildcard, then named parameters, then catch-all.

Exact match/old-page → https://example.com/new-page

Matches only the exact path specified. The fastest and most predictable rule type. Use this for individual page redirects.

Wildcard/blog/* → https://example.com/posts

Matches any path that starts with the prefix. The * matches one or more path segments. Use this when redirecting an entire section to a single destination.

Named parameters/posts/[slug] → https://example.com/articles/[slug]

Matches a path segment and substitutes its value into the destination. Use this when the URL structure changes but the slug or ID stays the same.

Catch-all(no source path) → https://example.com

Matches any request that has no other matching rule. Set by leaving the source path blank. Useful for full domain redirects.

Pattern matching

Wildcard ( * )

A * at the end of a source path matches any continuation of that path. It does not capture the matched value for use in the destination — use named parameters if you need to carry the value through.

Wildcard examples
/blog/* matches /blog/any-post, /blog/2024/post, ...
/products/* matches /products/widget, /products/widget/details, ...

Match priority order

  1. 1Exact match — /old-page
  2. 2Wildcard — /blog/*
  3. 3Named parameter — /posts/[slug]
  4. 4Catch-all — (blank source path)

Named parameter capture

Named parameters let you capture a URL segment and substitute it into the destination. This is the right tool when your URL structure changes but IDs, slugs, or other values stay the same — common in CMS migrations and domain rebrands.

Single parameter — [param]

Matches exactly one path segment (no slashes). The captured value is substituted wherever [param] appears in the destination.

Example
Source: /posts/[slug]
Destination: https://newsite.com/articles/[slug]
/posts/my-post → https://newsite.com/articles/my-post
/posts/hello-world → https://newsite.com/articles/hello-world

Multiple parameters

Use multiple named segments to capture and rearrange URL structure.

Example — blog archive migration
Source: /blog/[year]/[slug]
Destination: https://newsite.com/[year]/posts/[slug]
/blog/2024/hello-world → https://newsite.com/2024/posts/hello-world

Spread parameter — [...rest]

Matches the rest of the path including slashes. Use when the path structure after a prefix changes completely.

Example — section rename
Source: /old-section/[...rest]
Destination: https://newsite.com/new-section/[...rest]
/old-section/a/b/c → https://newsite.com/new-section/a/b/c

Note: [param] matches exactly one segment with no slashes. If you need to match multiple segments, use [...rest] or a wildcard rule.

Path & query passthrough

Two optional toggles control how the request path and query string are forwarded.

Preserve path

Appends the full incoming request path to the destination URL. Useful for catch-all rules where you want to mirror the path structure on the new domain.

Catch-all with preserve path
Destination: https://newsite.com
/old/path → https://newsite.com/old/path

Preserve query

Appends the incoming query string to the destination URL. Useful when visitors arrive with UTM parameters or search queries that should carry through to the new location.

Exact match with preserve query
Source: /old-page → https://newsite.com/new-page
/old-page?ref=email → https://newsite.com/new-page?ref=email

Bulk CSV import

Import hundreds of redirect rules at once from a CSV file. All rule types are supported — exact paths, wildcards, named parameters, and catch-alls can all be defined in CSV. This is the fastest way to migrate from Cloudflare Page Rules, .htaccess, Nginx configs, or another redirect management tool.

Full bulk import reference — format, validation, Excel tips, migration guides →
1Open your domain in the dashboard.
2Click "Import CSV" next to the "Add rule" button.
3Upload your CSV file. Max 500 rows, 1 MB.
4Review the results. Invalid rows are reported with a row number and error message — valid rows are imported immediately.
5Rules go live globally within about 60 seconds.

Migrating from Cloudflare Page Rules?

Cloudflare Page Rules are deprecated. If you were using Page Rules for URL forwarding, export your rules from the Cloudflare dashboard and convert them to the CSV format below. Most Page Rules forwarding patterns map directly — see our Cloudflare migration guide for a field-by-field comparison.

CSV format reference

Columns

ColumnRequiredDescription
source_pathYesPath to match. Must start with /. Leave blank for catch-all.
destinationYesFull destination URL including https://.
typeNo301 or 302. Defaults to 301 if omitted.

Example CSV

source_path,destination,type
/old-page,https://newsite.com/new-page,301
/blog/*,https://newsite.com/posts,301
/posts/[slug],https://newsite.com/articles/[slug],301
/old-section/[...rest],https://newsite.com/new-section/[...rest],301
,https://newsite.com,301

The last row (blank source_path) creates a catch-all rule.

Rules & limits

Header row is optional. If the first row's first cell doesn't start with /, it is treated as a header and skipped.
Maximum 500 rows per import. For larger migrations, split into multiple files.
Maximum file size: 1 MB.
Invalid rows are skipped and reported — valid rows in the same file are still imported.
Duplicate source paths are not deduplicated automatically. If a path already has a rule, a second rule for the same path will be ignored at match time (first match wins).

Plan limits

PlanRules per domainCSV import
Hobby (free)100Up to 100 (plan limit applies)
ProUnlimitedUp to 500 rows per file
AgencyUnlimitedUp to 500 rows per file (split large sets across files)

Have questions not covered here?

Contact us →