Cloudflare Docs
Rules
Rules
Edit this page
Give us feedback
Set theme to dark (⇧+D)

Available fields and functions in rewrite URL rules

​​ Filter expressions

A rewrite URL rule filter expression (that is, the expression that defines which incoming requests match the rule) can include the following fields:

  • cf.edge.server_ip
  • cf.edge.server_port
  • cf.edge.client_port
  • cf.zone.name
  • cf.metal.id
  • cf.ray_id
  • cf.tls_client_auth.*
  • http.cookie
  • http.host
  • http.referer
  • http.request.headers
  • http.request.headers.*
  • http.request.accepted_languages
  • http.request.method
  • http.request.timestamp.sec
  • http.request.timestamp.msec
  • http.request.full_uri
  • http.request.uri
  • http.request.uri.*
  • http.request.version
  • raw.http.request.full_uri
  • raw.http.request.uri
  • raw.http.request.uri.*
  • http.user_agent
  • http.x_forwarded_for
  • ip.src
  • ip.src.lat
  • ip.src.lon
  • ip.src.city
  • ip.geoip.*
  • ssl

Refer to Fields for reference information on these fields.

For information on the available functions, refer to Functions.

​​ Rewrite expressions

A rewrite expression (that is, the expression that defines the dynamic URL rewrite to perform) can only include the following fields:

  • http.request.uri.*
  • http.request.headers.*
  • http.request.accepted_languages

Refer to Fields for reference information on these fields.

The concat() and regex_replace() functions can appear only once in a rewrite expression.