DEV Community

review
review

Posted on Originally published at casinothaibetzone.pages.dev

Cloudflare Pages Redirects: What Nobody Tells You About the Free Plan Limit

If you run a site on Cloudflare Pages and maintain a large _redirects file, this one is for you — because the documented limits and reality do not match, and the failure mode is silent.

The documented limit

Cloudflare's docs state the _redirects file supports up to 2,000 static redirect rules. The docs also say static rules should appear before dynamic (wildcard) rules because matching is first-match.

The reality: silent truncation

In practice, accounts on the Free plan have hit a hard wall far below 2,000. In our case, rules beyond roughly the first 100-190 lines stopped working entirely — no error, no warning, just 404s on URLs that should have redirected.

How we confirmed it:

  1. Deployed a fresh build with 220 rules. The last ~30 rules 404'd.
  2. Moved a failing rule to the top of the file and redeployed → it worked instantly.
  3. Conclusion: the file was being truncated at the top, silently, well below the documented limit.

The community has multiple threads reporting the same behavior on Free accounts. It is not in the docs.

The fix: Bulk Redirects

Instead of fighting _redirects, use Cloudflare Bulk Redirects (Rules API), which handles far more entries:

  1. Create a Redirect List (supports up to 10,000 items).
  2. Add each redirect as a list item with source_url and target_url.
  3. Create a ruleset rule of type http_request_redirect that references the list.

The gotcha that cost us a deploy

The source_url must include the full domainexample.com/blog/ — not just a path like /blog/. Path-only entries silently fail to match. We lost a cycle to that one, so: always store full URLs in the list.

# create a redirect list
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/{account_id}/rules/lists/{list_id}"   -H "Authorization: Bearer $TOKEN"   -d '{"name":"my_redirects","kind":"redirect","items":[
    {"source_url":"example.com/old/","target_url":"example.com/new/","status_code":301}
  ]}'
Enter fullscreen mode Exit fullscreen mode

Lessons for your own site

  • Test the last rules in your file, not just the first ones — silent truncation hides there.
  • If you have >100 rules, use Bulk Redirects from day one.
  • Always include the full domain in Bulk Redirect source URLs.
  • Add a post-deploy smoke test that curls the last 5 rules in the file.

We applied this exact fix to a production site with 157 redirects — every previously-404 URL started redirecting correctly within minutes. Our review hub CASINO THAI BET ZONE runs on the same architecture.

The takeaway

Trust but verify — especially when a vendor's docs promise 2,000 and reality silently delivers 100. If you maintain a large redirect file, move to Bulk Redirects and add smoke tests. Your users will never see a 404 again.

Originally published on CASINO THAI BET ZONE.

Top comments (0)