In short. Subpath matching controls the match, while Preserve path suffix controls whether the unmatched path remainder reaches the target.
Definition: In Cloudflare Bulk Redirects, Subpath matching decides whether a request below a source directory matches the redirect. Preserve path suffix decides whether the unmatched path portion is appended to the target URL. With both enabled,
/my-folder/foomaps to/another-folder/foo.
Key facts
- The
subpath_matchingAPI field is a Boolean whose default isfalse. When it istrue, Cloudflare applies the subpath matching algorithm to the request URL. Cloudflare documents this in its URL redirect parameters reference. - The
preserve_path_suffixAPI field is a Boolean whose default istrue. It applies only when Subpath matching is enabled. - With both settings enabled, a redirect from
/my-folder/to/another-folder/sends/my-folder/footo/another-folder/foo. With Preserve path suffix disabled, the same request still matches and goes to/another-folder/. - Cloudflare's Bulk Redirects matching guide describes Subpath matching as applying to all paths under the exact source path.
- When Subpath matching is enabled, the source URL path cannot contain more than 16 slash characters.
How does Subpath matching find the request path?
Cloudflare compares the request scheme, hostname, and path with the source URL. The matching guide says that a source path matches exactly by default. If Subpath matching is enabled, Cloudflare also considers paths below that source path. A source of https://example.com/foo/ and a target of https://example.com/qux/ therefore matches example.com/foo/bar and redirects it to https://example.com/qux/bar.
The match and the target construction are separate decisions. Enabling Subpath matching makes the deeper request eligible for the redirect. It does not by itself decide whether the unmatched bar segment is copied to the target.
What does Preserve path suffix change?
Preserve path suffix is the target-path setting for the remainder that Subpath matching leaves outside the configured source path. Cloudflare defines that remainder as the non-matched path elements of the source URL. Its default is true, so the suffix is included when Subpath matching is active.
{
"source_url": "/my-folder/",
"target_url": "/another-folder/",
"subpath_matching": true,
"preserve_path_suffix": true
}
For this configuration, the documented mapping is /my-folder/foo to /another-folder/foo. Changing preserve_path_suffix to false keeps the match but produces /another-folder/. The target URL remains the configured destination base, while the request's unmatched suffix is omitted.
How is the final redirect URL determined?
Cloudflare's parameters reference states that the final target URL depends on Preserve query string and Preserve path suffix. Preserve query string is a separate Boolean, with a default of false, that controls the original request's query string. When it is enabled, Cloudflare uses that original query string and discards a query string written on the target URL, including when the request has no query string.
Bulk Redirects are evaluated before Cloudflare sends the request to the origin server. The matching guide says that, after a redirect action is executed, Cloudflare performs no further processing. A path test therefore needs to inspect both the matched source path and the complete target path, including the suffix setting.
Related terms
- HTTP redirects
- How do I create redirects on Cloudflare Pages?
- Which redirect wins when Cloudflare Pages rules overlap?
FAQ
Does Preserve path suffix make a deeper path match?
No. Subpath matching controls whether a path such as /my-folder/foo matches /my-folder/. Preserve path suffix controls what happens to foo after that match.
What happens when Preserve path suffix is false?
The deeper request still matches when Subpath matching is enabled. Cloudflare redirects it to the configured target path without the unmatched suffix.
What are the defaults?
Subpath matching defaults to false, and Preserve path suffix defaults to true. The suffix setting becomes applicable when Subpath matching is enabled.
Sources
- Cloudflare, "URL redirect parameters", 26 June 2026
- Cloudflare, "How Bulk Redirects work", 5 May 2026
Check how a page reads to answer engines. Open the GEO score analyzer