LLevelUp
0
← Back to topic

Rulesets and Page Rules

Cloudflare Rules let you change behavior based on hostname, path, headers, IP, country, or other request attributes. Older Cloudflare setups often used Page Rules; newer setups use dedicated Rulesets.

Common use cases:

  • Redirect www to apex or apex to www
  • Force HTTPS
  • Cache static paths more aggressively
  • Add response headers
  • Route traffic to Workers
if path starts_with "/assets/" then cache TTL = 1 month

TIP

Keep rules boring. Write the purpose in the rule name, and avoid overlapping conditions unless you understand precedence.

Further Learning

  • “Cloudflare Ruleset Engine” — rules architecture
  • “Cloudflare Redirect Rules” — URL redirects
  • “Cloudflare Transform Rules” — header/path changes