Need help migrating BackBlaze B2 CDN cache rule and redirect rules

I am using BackBlaze B2 and they gave a guide on directory browsing by redirecting it. And here is what I did with old Page Rules configuration.

I can successfully migrate the cache rule but I can’t figure out how to migrate the redirect rule. Any help is appreciated.

Regarding migrating Migrate Forwarding URL on Page Rules, you can take a look at this instruction: Page Rules migration guide · Cloudflare Rules docs

Well, I can’t work it out even after looking at the migration guide and I have already tried it before posting here. The example in the guide is so simple but mine is a bit complex. Can you help?

If you just need to redirect everything from ** to a static URL, you can use something like http.request.full_uri contains "" as a filter and redirect to

If you need to target precisely **/*, then you can use matches operator to filter on contains "" and http.request.uri.path matches "^/file/$/$", but this requires Business or Enterprise plan.

If wildcards should also be expanded in the URL forwarding destination (i.e. you need to redirect to$1/$2/$3), the easiest way to achieve this is via regex_replace. You can adopt the example from Page rules are now deprecated without good replacements? - #4 by ncano if you have access to this function.

Alternatively, we are releasing wildcard support in Rules this year, so you can keep using Page Rules safely until we have shipped this functionality.

We are also adding more examples to the Page Rules migration guide in the coming weeks to guide users with more advanced use cases.

What you said is suitable for redirecting but it is also redirecting the asset files. I need to let it pass if the url is asset files. I tried with “http.request.full_uri contains the dot (.)” but it didn’t work.

I am sorry if my question wasn’t clear at first. Here are more details.

The cache rule (rule position 1 in the screenshot) was migrated successfully.

But when I tried to migrate the rest of the two rules (rules 2 and 3 in the screenshot), the asset urls cached by the first rule were also captured and redirected to

In the previous version of the page rules, those 3 rules worked perfectly together. As you can see, the first rule also contains “” but with extra “*-cdn/”. Therefore, my current expression to catch the request is:

(starts_with(http.request.full_uri, "") and not http.request.full_uri contains "-cdn") or (starts_with(http.request.full_uri, "") and not http.request.full_uri contains "-cdn") or (ends_with(http.request.full_uri, "-cdn/"))

and then I redirect it to but this doesn’t fulfill 2 things, like the old rules.

  1. it cannot prevent directory browsing unless it ends with -cdn/
  2. The 23le in can be any other name, and the current migrated rule can only catch what was specified.

Please let me know if my requirements are still confusing.

Did you try something like http.request.uri.path.extension eq "" to exclude assets already? This should prevent directory browsing.

For the rest of your requirements, let’s abstract away from your Page Rules implementation and just focus on the desired behaviour you want to achieve, with URL examples if possible. This should make it easier for us to help you craft the optimal rule.

It says it is not supported when I switch to the expression builder.

with URL examples if possible.

URL examples are in the first screenshot.

But here’s more detail. I am hosting assets (jpg, png, pdf, etc.) for multiple websites on S3. The CDN host can be anything but it will always include “*-cdn/”. It can be

  1. just
  2. or

and you get the idea. Here is full url for one asset

I want Cloudflare to cache asset URLs like this but I want to redirect to root ( for URLs like following (to prevent directory browsing) (without “-cdn”)

Please let me know if you need further information. I really appreciate your help.