You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rules features require that you [proxy the DNS records](/dns/manage-dns-records/reference/proxied-dns-records/) of your domain (or subdomain) through Cloudflare.
Redirect visitors from a source URL to a target URL with a specific HTTP status code. Use Single Redirects or Bulk Redirects depending on your use case.
45
+
Redirect visitors from a source URL to a target URL with a specific HTTP
46
+
status code. Use Single Redirects or Bulk Redirects depending on your use
Customize where the incoming traffic will go and with which parameters. Override request properties such as `Host` header, destination hostname, and destination port.
51
+
Customize where the incoming traffic will go and with which parameters.
52
+
Override request properties such as `Host` header, destination hostname, and
Customize the compression applied to responses from Cloudflare's global network to your website visitors, based on the file extension and content type.
61
+
Customize the compression applied to responses from Cloudflare's global
62
+
network to your website visitors, based on the file extension and content
63
+
type.
46
64
</Feature>
47
65
48
66
<Featureheader="Snippets"href="/rules/snippets/">
49
-
Customize the behavior of your website or application using short pieces of JavaScript code.
67
+
Customize the behavior of your website or application using short pieces of
Cloudflare Workers provides a serverless execution environment that allows you to create new applications or augment existing ones without configuring or maintaining infrastructure.
111
+
Cloudflare Workers provides a serverless execution environment that allows you
112
+
to create new applications or augment existing ones without configuring or
To modify HTTP headers in the **response** sent to website visitors, refer to [HTTP response header modification rules](/rules/transform/response-header-modification/).
37
36
38
37
Through HTTP request header modification rules you can:
39
38
40
-
* Set the value of an HTTP request header to a literal string value, overwriting its previous value or adding a new header to the request.
41
-
* Set the value of an HTTP request header according to an expression, overwriting its previous value or adding a new header to the request.
42
-
* Remove an HTTP header from the request.
39
+
- Set the value of an HTTP request header to a literal string value, overwriting its previous value or adding a new header to the request.
40
+
- Set the value of an HTTP request header according to an expression, overwriting its previous value or adding a new header to the request.
41
+
- Remove an HTTP header from the request.
43
42
44
43
You can create an HTTP request header modification rule [in the dashboard](/rules/transform/request-header-modification/create-dashboard/) or [via API](/rules/transform/request-header-modification/create-api/).
* You cannot modify or remove HTTP request headers whose name starts with `x-cf-` or `cf-` except for the `cf-connecting-ip` HTTP request header, which you can remove.
52
+
- You cannot modify or remove HTTP request headers whose name starts with `x-cf-` or `cf-` except for the `cf-connecting-ip` HTTP request header, which you can remove.
51
53
52
-
* Due to protocol compliance reasons, modifying or removing request headers with [forbidden header names](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name) (such as `Accept-Encoding`) is generally not allowed in request header modification rules.
54
+
- Due to protocol compliance reasons, modifying or removing request headers with [forbidden header names](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name) (such as `Accept-Encoding`) is generally not allowed in request header modification rules.
53
55
54
-
* You cannot modify the value of any header commonly used to identify the website visitor's IP address, such as `x-forwarded-for`, `true-client-ip`, or `x-real-ip`. Additionally, you cannot remove the `x-forwarded-for` header.
56
+
- You cannot modify the value of any header commonly used to identify the website visitor's IP address, such as `x-forwarded-for`, `true-client-ip`, or `x-real-ip`. Additionally, you cannot remove the `x-forwarded-for` header.
55
57
56
-
* You cannot set or modify the value of `cookie` HTTP request headers, but you can remove these headers. Configuring a rule that removes the `cookie` HTTP request header will remove all `cookie` headers in matching requests.
58
+
- You cannot set or modify the value of `cookie` HTTP request headers, but you can remove these headers. Configuring a rule that removes the `cookie` HTTP request header will remove all `cookie` headers in matching requests.
57
59
58
-
* If you modify the value of an existing HTTP request header using an expression that evaluates to an empty string (`""`) or an undefined value, the HTTP request header is **removed**.
60
+
- If you modify the value of an existing HTTP request header using an expression that evaluates to an empty string (`""`) or an undefined value, the HTTP request header is **removed**.
59
61
60
-
* The HTTP request header removal operation will remove all request headers with the provided name.
62
+
- The HTTP request header removal operation will remove all request headers with the provided name.
61
63
62
-
* Currently, there is a limited number of HTTP request headers that you cannot modify. Cloudflare may remove restrictions for some of these HTTP request headers when presented with valid use cases. [Create a post in the community](https://community.cloudflare.com) for consideration.
64
+
- Currently, there is a limited number of HTTP request headers that you cannot modify. Cloudflare may remove restrictions for some of these HTTP request headers when presented with valid use cases. [Create a post in the community](https://community.cloudflare.com) for consideration.
63
65
64
-
* To use [claims inside a JSON Web Token (JWT)](/api-shield/security/jwt-validation/transform-rules/), you must first set up a token validation configuration in API Shield.
66
+
- To use [claims inside a JSON Web Token (JWT)](/api-shield/security/jwt-validation/transform-rules/), you must first set up a token validation configuration in API Shield.
Copy file name to clipboardExpand all lines: src/content/docs/rules/url-forwarding/bulk-redirects/index.mdx
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,23 @@ sidebar:
6
6
head:
7
7
- tag: title
8
8
content: Bulk Redirects
9
-
10
9
---
11
10
12
-
import { Render } from"~/components"
11
+
import { Render } from"~/components";
13
12
14
13
Bulk Redirects allow you to define a large number of URL redirects at the account level. These redirects navigate the user from a source URL to a target URL using a given HTTP status code. URL redirection is also known as URL forwarding.
15
14
16
15
Unlike dynamic URL redirects created in [Single Redirects](/rules/url-forwarding/single-redirects/), Bulk Redirects are essentially static — they do not support string replacement operations or regular expressions. However, you can configure URL redirect parameters that affect their URL matching behavior and their runtime behavior.
*[Availability](/rules/url-forwarding/#availability): Information on the Bulk Redirects quotas and features per Cloudflare plan.
25
-
*[Execution order](/rules/url-forwarding/#execution-order): Execution order of the different Rules products.
26
-
*[Trace a request](/fundamentals/basic-tasks/trace-request/): Use Cloudflare Trace to determine if a bulk redirect rule is triggering for a specific URL.
26
+
-[Availability](/rules/url-forwarding/#availability): Information on the Bulk Redirects quotas and features per Cloudflare plan.
27
+
-[Execution order](/rules/url-forwarding/#execution-order): Execution order of the different Rules products.
28
+
-[Trace a request](/fundamentals/basic-tasks/trace-request/): Use Cloudflare Trace to determine if a bulk redirect rule is triggering for a specific URL.
Single Redirects allow you to create static or dynamic URL <GlossaryTooltipterm="redirect">redirects</GlossaryTooltip>. A simple interface with [wildcard support](/ruleset-engine/rules-language/operators/#wildcard-matching) makes it easy to define source and target URL patterns without needing complex functions or regular expressions, efficiently handling thousands of URLs with a single rule. Dynamic URL redirects also support advanced features such as string replacement operations and [regular expressions](/ruleset-engine/rules-language/values/#string-values-and-regular-expressions) (depending on your Cloudflare plan).
Copy file name to clipboardExpand all lines: src/content/docs/ruleset-engine/rules-language/expressions/index.mdx
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,9 @@ sidebar:
6
6
head:
7
7
- tag: title
8
8
content: Rule expressions
9
-
10
9
---
11
10
12
-
import { Render } from"~/components"
11
+
import { Render } from"~/components";
13
12
14
13
The Rules language supports two kinds of expressions: simple and compound.
15
14
@@ -29,11 +28,11 @@ Simple expressions have the following syntax:
29
28
30
29
Where:
31
30
32
-
*[Fields](/ruleset-engine/rules-language/fields/) specify properties associated with an HTTP request.
31
+
-[Fields](/ruleset-engine/rules-language/fields/) specify properties associated with an HTTP request.
33
32
34
-
*[Comparison operators](/ruleset-engine/rules-language/operators/#comparison-operators) define how values must relate to actual request data for an expression to return `true`.
33
+
-[Comparison operators](/ruleset-engine/rules-language/operators/#comparison-operators) define how values must relate to actual request data for an expression to return `true`.
35
34
36
-
*[Values](/ruleset-engine/rules-language/values/) represent the data associated with fields. When evaluating a rule, Cloudflare compares these values with the actual data obtained from the request.
35
+
-[Values](/ruleset-engine/rules-language/values/) represent the data associated with fields. When evaluating a rule, Cloudflare compares these values with the actual data obtained from the request.
37
36
38
37
## Compound expressions
39
38
@@ -55,14 +54,14 @@ Compound expressions allow you to generate sophisticated, highly targeted rules.
55
54
56
55
## Maximum rule expression length
57
56
58
-
<Renderfile="max-expression-length" /> <br/>
57
+
<Renderfile="max-expression-length" />
59
58
60
59
This limit applies whether you use the visual [Expression Builder](/ruleset-engine/rules-language/expressions/edit-expressions/#expression-builder) to define your expression, or write the expression manually in the [Expression Editor](/ruleset-engine/rules-language/expressions/edit-expressions/#expression-editor).
61
60
62
61
## Additional features
63
62
64
63
You can also use the following Rules language features in your expressions:
65
64
66
-
*[Grouping symbols](/ruleset-engine/rules-language/operators/#grouping-symbols) allow you to explicitly group expressions that should be evaluated together.
65
+
-[Grouping symbols](/ruleset-engine/rules-language/operators/#grouping-symbols) allow you to explicitly group expressions that should be evaluated together.
67
66
68
-
*[Functions](/ruleset-engine/rules-language/functions/) allow you to manipulate and validate values in expressions.
67
+
-[Functions](/ruleset-engine/rules-language/functions/) allow you to manipulate and validate values in expressions.
0 commit comments