diff --git a/src/content/docs/rules/cloud-connector/create-dashboard.mdx b/src/content/docs/rules/cloud-connector/create-dashboard.mdx index 175b81464f61a1..a1d2ea20c1dd27 100644 --- a/src/content/docs/rules/cloud-connector/create-dashboard.mdx +++ b/src/content/docs/rules/cloud-connector/create-dashboard.mdx @@ -8,10 +8,12 @@ head: content: Configure a Cloud Connector rule in the dashboard --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; To configure a Cloud Connector rule in the dashboard: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain. 2. Go to **Rules** > **Cloud Connector**. @@ -38,3 +40,5 @@ To configure a Cloud Connector rule in the dashboard: 7. To save and deploy your rule, select **Deploy**. If you are not ready to deploy the rule, select **Save as Draft**. + + diff --git a/src/content/docs/rules/cloud-connector/examples/route-images-to-s3.mdx b/src/content/docs/rules/cloud-connector/examples/route-images-to-s3.mdx index 1f2ca405b486d4..9597fdf4e667b6 100644 --- a/src/content/docs/rules/cloud-connector/examples/route-images-to-s3.mdx +++ b/src/content/docs/rules/cloud-connector/examples/route-images-to-s3.mdx @@ -7,8 +7,12 @@ products: - Cloud Connector --- +import { Steps } from "~/components"; + To route requests to `/images` on your domain to an AWS S3 bucket: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain. 2. Go to **Rules** > **Cloud Connector**. 3. Select **Amazon Web Services - S3** as your [cloud provider](/rules/cloud-connector/providers/). @@ -26,4 +30,6 @@ To route requests to `/images` on your domain to an AWS S3 bucket: Replace `` with desired hostname. 9. Select **Deploy** to activate the rule. + + This setup will route all traffic matching `http*:///images/*` (HTTPS and HTTP requests) to your S3 bucket. Make sure to replace `` with your actual hostname and adjust the example paths according to your setup. diff --git a/src/content/docs/rules/cloud-connector/examples/send-eu-visitors-to-gcs.mdx b/src/content/docs/rules/cloud-connector/examples/send-eu-visitors-to-gcs.mdx index 10dc34352d29ee..ff268a3843d2b2 100644 --- a/src/content/docs/rules/cloud-connector/examples/send-eu-visitors-to-gcs.mdx +++ b/src/content/docs/rules/cloud-connector/examples/send-eu-visitors-to-gcs.mdx @@ -7,8 +7,12 @@ products: - Cloud Connector --- +import { Steps } from "~/components"; + To route requests from visitors in the European Union to a Google Cloud Storage bucket: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain. 2. Go to **Rules** > **Cloud Connector**. 3. Select **Google Cloud Platform - Cloud Storage** as your [cloud provider](/rules/cloud-connector/providers/). @@ -23,4 +27,6 @@ To route requests from visitors in the European Union to a Google Cloud Storage This expression targets traffic from European Union users. 9. Select **Deploy** to activate the rule. + + This configuration will route traffic from EU visitors to your Google Cloud Storage bucket. Make sure to replace `` with your actual hostname and adjust the example paths according to your setup. diff --git a/src/content/docs/rules/cloud-connector/examples/serve-static-assets-from-azure.mdx b/src/content/docs/rules/cloud-connector/examples/serve-static-assets-from-azure.mdx index 3d22e8352743bd..b1d8700b609b3e 100644 --- a/src/content/docs/rules/cloud-connector/examples/serve-static-assets-from-azure.mdx +++ b/src/content/docs/rules/cloud-connector/examples/serve-static-assets-from-azure.mdx @@ -7,8 +7,12 @@ products: - Cloud Connector --- +import { Steps } from "~/components"; + To serve static assets from an Azure Blob Storage container: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain. 2. Navigate to **Rules** > **Cloud Connector**. 3. Select **Microsoft Azure - Blob Storage** as your [cloud provider](/rules/cloud-connector/providers/). @@ -21,4 +25,6 @@ To serve static assets from an Azure Blob Storage container: `http.request.full_uri wildcard "http*:///static-assets/*"`
9. Select **Deploy** to activate the rule. +
+ This setup ensures that all traffic matching `http*:///static-assets/*` (HTTPS and HTTP requests) is served from your Azure Blob Storage container. Make sure to replace `` with your actual hostname and adjust the example paths according to your setup. diff --git a/src/content/docs/rules/cloud-connector/providers.mdx b/src/content/docs/rules/cloud-connector/providers.mdx index 710b000564de74..6c3f39314972d5 100644 --- a/src/content/docs/rules/cloud-connector/providers.mdx +++ b/src/content/docs/rules/cloud-connector/providers.mdx @@ -5,7 +5,7 @@ sidebar: order: 5 --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; Cloud Connector currently supports the following cloud providers and services: @@ -43,11 +43,15 @@ The SSL setting applied to requests between Cloud Connector and AWS S3 depends o ### Get the bucket URL + + 1. Go to the [Amazon S3 console](https://console.aws.amazon.com/s3/) and select **Buckets** in the navigation pane. 2. Select the bucket name. 3. Go to the **Properties** tab. 4. Select the **Static Website Hosting** card. The **Endpoint** field shows your bucket URL. + + For more information, refer to the [Amazon S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/EnableWebsiteHosting.html). @@ -66,6 +70,8 @@ Cloud Connector supports both subdomain and URI path-style URLs: ### Get the bucket URL + + 1. Go to the [Google Cloud console](https://console.cloud.google.com/storage/browser) and select **Buckets**. 2. Select the bucket name. 3. For one of the files already in the bucket, select the link icon in the **Public** column to copy the file's public URL to the clipboard. The file URL will have the following format: @@ -75,6 +81,8 @@ Cloud Connector supports both subdomain and URI path-style URLs: To obtain the subdomain bucket URL, refactor the file URL to `.storage.googleapis.com` format.
To obtain the URI path bucket URL, remove `https://` and `//` from the file URL. +
+ If the files in your bucket are not publicly accessible, you must change the bucket permissions. For details, refer to the [Google Cloud Storage documentation](https://cloud.google.com/storage/docs/access-control/making-data-public#buckets). @@ -90,10 +98,14 @@ For Azure Blog Storage, Cloud Connector supports only subdomain URLs like ` + 1. Go to the [Azure portal](https://portal.azure.com/) and select your storage account. 2. In the menu pane, under **Settings**, select **Endpoints**. 3. Get your bucket URL from the **Blob service** endpoint or the **Static website** endpoint. + + If the blob container is not configured for public access, you must change the container settings. For details, refer to the [Azure Storage documentation](https://learn.microsoft.com/en-us/azure/storage/blobs/anonymous-read-access-configure?tabs=portal). diff --git a/src/content/docs/rules/compression-rules/create-dashboard.mdx b/src/content/docs/rules/compression-rules/create-dashboard.mdx index a27e7d4a74cbee..168dd351797eb4 100644 --- a/src/content/docs/rules/compression-rules/create-dashboard.mdx +++ b/src/content/docs/rules/compression-rules/create-dashboard.mdx @@ -6,7 +6,9 @@ sidebar: label: Create a rule in the dashboard --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain. 2. Go to **Rules** > **Overview**. @@ -19,3 +21,5 @@ import { Render } from "~/components"; 9. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**. + + \ No newline at end of file diff --git a/src/content/docs/rules/configuration-rules/create-dashboard.mdx b/src/content/docs/rules/configuration-rules/create-dashboard.mdx index 5592275d099ae1..c98096685782a8 100644 --- a/src/content/docs/rules/configuration-rules/create-dashboard.mdx +++ b/src/content/docs/rules/configuration-rules/create-dashboard.mdx @@ -6,7 +6,9 @@ sidebar: label: Create a rule in the dashboard --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain. 2. Go to **Rules** > **Overview**. @@ -19,3 +21,5 @@ import { Render } from "~/components"; 9. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**. + + \ No newline at end of file diff --git a/src/content/docs/rules/custom-errors/create-rules.mdx b/src/content/docs/rules/custom-errors/create-rules.mdx index 8e9c8891333e37..63d5c5f00a6468 100644 --- a/src/content/docs/rules/custom-errors/create-rules.mdx +++ b/src/content/docs/rules/custom-errors/create-rules.mdx @@ -5,12 +5,14 @@ sidebar: order: 3 --- -import { APIRequest, Render } from "~/components"; +import { APIRequest, Render, Steps } from "~/components"; ## In the dashboard ### Create a custom error rule {/* create-a-custom-error-rule-dashboard */} + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website. 2. Go to **Rules** > **Overview**. 3. Select **Create rule** > **Custom Error Rule**. @@ -33,22 +35,32 @@ import { APIRequest, Render } from "~/components"; 9. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**. + + ### Create a custom error asset {/* create-a-custom-error-asset-dashboard */} + + 1. In the **Create Custom Error Asset** sidebar, enter a name for the asset in **Asset name**. 2. (Optional) Enter a description for the asset in **Description**. 3. In **URL**, enter the URL of the page you want to fetch and store in Cloudflare's global network. Cloudflare will fetch all the page resources and store a minified version of the page you can use in one or more custom error rules. 4. Select **Save**. + + To review existing custom error assets, go to **Rules** > **Settings** > **Custom Error Assets** tab. ## Via API To configure a custom error rule via API: + + 1. (Optional) [Create a custom error asset](#create-a-custom-error-asset-api) based on a URL you provide. 2. [Create a custom error rule](#create-a-custom-error-rule-api) in the `http_custom_errors` phase, using the [Rulesets API](/ruleset-engine/rulesets-api/). + + ### Create a custom error asset {/* create-a-custom-error-asset-api */} The following `POST` request creates new a custom error asset in a zone based on the provided URL: @@ -86,18 +98,22 @@ When creating a custom error rule via API, make sure you: The first rule in the `http_custom_errors` phase ruleset that matches will be applied. No other rules in the ruleset will be matched or applied. Additionally, custom error rules defined at the zone level will have priority over rules defined at the account level. -### General procedure +#### General procedure Follow this workflow to create a custom error rule for a given zone via API: + + 1. Use the [List zone rulesets](/api/resources/rulesets/methods/list/) operation to check if there is already a ruleset for the `http_custom_errors` phase at the zone level. 2. If the phase ruleset does not exist, create it using the [Update a zone entry point ruleset](/api/resources/rulesets/subresources/phases/methods/update/) operation, which allows you to create a ruleset if it does not exist and update all the rules in the ruleset. Create the ruleset in the `http_custom_errors` phase. If the phase ruleset already exists, use the [Update a zone entry point ruleset](/api/resources/rulesets/subresources/phases/methods/update/) operation to replace all the rules in the ruleset, or the [Add rule to ruleset](/ruleset-engine/rulesets-api/add-rule/) operation to add a rule to the existing rules in the ruleset. + + To create a custom error rule at the account level, use the corresponding account-level API endpoints. -### Example +#### Example This example configures a custom error rule returning a [previously created custom error asset](#create-a-custom-error-asset-api) named `500_error_template` for responses with a `500` HTTP status code. @@ -131,7 +147,7 @@ This example configures a custom error rule returning a [previously created cust This `PUT` request, corresponding to the [Update a zone entry point ruleset](/api/resources/rulesets/subresources/phases/methods/update/) operation, replaces any existing rules in the `http_custom_errors` phase entry point ruleset. -## Required API token permissions +### Required API token permissions The API token used in API requests to manage Custom Error Rules and Custom Error Assets must have at least the following permission: diff --git a/src/content/docs/rules/custom-errors/edit-error-pages.mdx b/src/content/docs/rules/custom-errors/edit-error-pages.mdx index 5bbec15c12677c..f4e4dd6a8076f0 100644 --- a/src/content/docs/rules/custom-errors/edit-error-pages.mdx +++ b/src/content/docs/rules/custom-errors/edit-error-pages.mdx @@ -5,7 +5,7 @@ sidebar: order: 2 --- -import { Details, DashButton } from "~/components"; +import { Details, DashButton, Steps } from "~/components"; ## Before you start @@ -61,6 +61,8 @@ The following HTML code is an example error page for 5XX errors without styling: To update an account-level custom error page: + + 1. In the Cloudflare dashboard, go to the **Settings** page. @@ -71,10 +73,14 @@ To update an account-level custom error page: 5. To use Cloudflare's default page, select **Cloudflare default page.** To provide a custom error page, select **Custom page** and enter the URL of the custom error page you created. 6. Select **Confirm**. + + ### Zone-level custom error page To edit a zone-level custom error page: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website. 2. Go to **Error Pages** and identify your desired custom error page type. 3. (Optional) To preview the current error page (default or custom), select the link in the **Show** column. @@ -82,6 +88,8 @@ To edit a zone-level custom error page: 5. To use Cloudflare's default page, select **Cloudflare default page.** To provide a custom error page, select **Custom page** and enter the URL of the custom error page you created. 6. Select **Confirm**. + + ### Fetch custom error page again After successfully setting the content of the custom error page in **Error Pages**, you can remove the page from your origin server. diff --git a/src/content/docs/rules/custom-errors/index.mdx b/src/content/docs/rules/custom-errors/index.mdx index a8958195c7435a..34d4b7987f8eff 100644 --- a/src/content/docs/rules/custom-errors/index.mdx +++ b/src/content/docs/rules/custom-errors/index.mdx @@ -8,7 +8,7 @@ head: content: Custom Errors --- -import { FeatureTable, Render } from "~/components"; +import { FeatureTable, Render, Steps } from "~/components"; Use Custom Errors to return custom content to your website visitors in case of HTTP errors returned by an origin server or by a Cloudflare product (including Workers), or when showing a [security challenge](/cloudflare-challenges/). @@ -25,6 +25,8 @@ Cloudflare has a set of default pages for presenting errors and challenges to yo When an error of a [specific type](/rules/custom-errors/reference/error-page-types/) occurs, Cloudflare does the following: + + 1. Search for a configured Error Page at the account level for the specific error. 2. Search for a configured Error Page at the zone level for the specific error (it will have priority over the account-level Error Page, if any). 3. Search for a matching custom error rule at the account level. The rule will have priority over 500 and 1000 class Error Pages at the account or zone level. @@ -32,6 +34,8 @@ When an error of a [specific type](/rules/custom-errors/reference/error-page-typ 5. If a security rule like a [WAF custom rule](/waf/custom-rules/) or a [rate limiting rule](/waf/rate-limiting-rules/) triggers a custom block response instead of a default Cloudflare WAF block page, the rule-specific block response will have priority over Error Pages or a matching custom error rule. 6. If any of the previous configurations apply, serve the custom error content to the visitor. If not, serve the default error page for the specific error type. + + :::note To customize a challenge page or a block page, use an Error Page, since Custom Error Rules will not be applied to security actions originating from Cloudflare products. Keep in mind that [custom WAF response](/waf/custom-rules/create-dashboard/#configure-a-custom-response-for-blocked-requests) takes precedence over an Error Page and custom error rules. ::: diff --git a/src/content/docs/rules/normalization/how-it-works.mdx b/src/content/docs/rules/normalization/how-it-works.mdx index 5958856bb932ad..5cf63a2c5542da 100644 --- a/src/content/docs/rules/normalization/how-it-works.mdx +++ b/src/content/docs/rules/normalization/how-it-works.mdx @@ -6,6 +6,8 @@ sidebar: label: How it works --- +import { Steps } from "~/components"; + URL normalization modifies separators, encoded elements, and literal bytes in incoming URLs so that they conform to a consistent formatting standard. For example, consider a WAF custom rule that blocks requests whose URLs match `www.example.com/hello`. The rule would not block a request containing an encoded element — `www.example.com/%68ello`. Normalizing incoming URLs on the Cloudflare global network helps simplify rules expressions containing URLs. @@ -36,6 +38,10 @@ The URL normalization performed according to [RFC 3986](https://www.ietf.org/rfc When using the Cloudflare URL normalization, some extra normalization techniques will be applied to URLs of incoming requests, in the following order: + + 1. Normalize back slashes (`\`) into forward slashes (`/`). 2. Merge successive forward slashes (for example, `//` will be normalized to `/`). 3. Perform [RFC 3986 normalization](#rfc-3986-normalization) of the resulting URL. + + \ No newline at end of file diff --git a/src/content/docs/rules/normalization/manage.mdx b/src/content/docs/rules/normalization/manage.mdx index 53069aaf4dc51b..c9e552e95dd7da 100644 --- a/src/content/docs/rules/normalization/manage.mdx +++ b/src/content/docs/rules/normalization/manage.mdx @@ -7,6 +7,10 @@ sidebar: description: How to configure URL normalization in the Cloudflare dashboard. --- +import { Steps } from "~/components"; + + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website. 2. Go to **Rules** > **Settings** and select the **URL Normalization** tab. @@ -14,3 +18,5 @@ description: How to configure URL normalization in the Cloudflare dashboard. 3. Configure the [available URL normalization settings](/rules/normalization/settings/). ![Available URL normalization settings in the Cloudflare dashboard](~/assets/images/rules/normalization/url-normalization-settings.png) + + \ No newline at end of file diff --git a/src/content/docs/rules/normalization/settings.mdx b/src/content/docs/rules/normalization/settings.mdx index 2dc9dfd762a139..a02213f8c95dcc 100644 --- a/src/content/docs/rules/normalization/settings.mdx +++ b/src/content/docs/rules/normalization/settings.mdx @@ -8,28 +8,33 @@ sidebar: The Cloudflare dashboard provides the following settings to manage URL normalization: -- **Normalization type** (default: _RFC-3986_) +## Normalization type - - Selects the type of normalization to perform: +Default value: _RFC-3986_ - - _RFC-3986_ – Applies URL normalization strictly according to [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). +Selects the type of normalization to perform: - - _Cloudflare_ – In addition to what is defined in RFC 3986, applies [extra URL normalization techniques](/rules/normalization/how-it-works/#cloudflare-normalization). +- _RFC-3986_ – Applies URL normalization strictly according to [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). +- _Cloudflare_ – In addition to what is defined in RFC 3986, applies [extra URL normalization techniques](/rules/normalization/how-it-works/#cloudflare-normalization). -- **Normalize incoming URLs** (default: _On_) +## Normalize incoming URLs - - Configures the URLs of all incoming traffic to Cloudflare: +Default value: _On_ - - When enabled, all incoming URLs are normalized before they pass to subsequent Cloudflare features that can receive a URL as input, such as Page Rules, WAF custom rules, Workers, and Access. - - When disabled, incoming URLs are not normalized before passing to subsequent Cloudflare features. +Configures the URLs of all incoming traffic to Cloudflare: -- **Normalize URLs to origin** (default: _Off_) +- When enabled, all incoming URLs are normalized before they pass to subsequent Cloudflare features that can receive a URL as input, such as Page Rules, WAF custom rules, Workers, and Access. +- When disabled, incoming URLs are not normalized before passing to subsequent Cloudflare features. - - Configures URLs sent to the origin: +## Normalize URLs to origin - - When enabled, requests sent to the origin are normalized. - - When disabled, requests sent to the origin are not modified. +Default value: _Off_ - - You can only view and enable this option when **Normalize incoming URLs** is enabled. +Configures URLs sent to the origin: + + - When enabled, requests sent to the origin are normalized. + - When disabled, requests sent to the origin are not modified. + +You can only view and enable this option when **Normalize incoming URLs** is enabled. For examples of how these settings affect URL normalization, refer to the [URL normalization examples](/rules/normalization/examples/). diff --git a/src/content/docs/rules/origin-rules/create-dashboard.mdx b/src/content/docs/rules/origin-rules/create-dashboard.mdx index b29b67321c6808..90b0e1e9a08d47 100644 --- a/src/content/docs/rules/origin-rules/create-dashboard.mdx +++ b/src/content/docs/rules/origin-rules/create-dashboard.mdx @@ -6,7 +6,9 @@ sidebar: label: Create a rule in the dashboard --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain. 2. Go to **Rules** > **Overview**. @@ -18,3 +20,5 @@ import { Render } from "~/components"; 8. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**. + + \ No newline at end of file diff --git a/src/content/docs/rules/origin-rules/tutorials/change-uri-path-and-host-header.mdx b/src/content/docs/rules/origin-rules/tutorials/change-uri-path-and-host-header.mdx index d04d8aa6203187..41c7a41b0d0bfe 100644 --- a/src/content/docs/rules/origin-rules/tutorials/change-uri-path-and-host-header.mdx +++ b/src/content/docs/rules/origin-rules/tutorials/change-uri-path-and-host-header.mdx @@ -8,9 +8,9 @@ products: - Origin Rules --- -import { Example } from "~/components"; +import { Example, Steps } from "~/components"; -This guide will instruct you how to modify both the URI path and the `Host` header of incoming requests using [Transform Rules](/rules/transform/) and Origin Rules. +This tutorial will instruct you how to modify both the URI path and the `Host` header of incoming requests using [Transform Rules](/rules/transform/) and Origin Rules. Your website visitors will be routed from `https:///uploads/*` to `https:///*`. @@ -23,6 +23,8 @@ By following these steps, you can effectively manage both URI paths and `Host` h ## 1. Create a URL rewrite + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain. 2. Go to **Rules** > **Overview**. 3. Select **Create rule** > **URL Rewrite Rule**. @@ -57,12 +59,16 @@ By following these steps, you can effectively manage both URI paths and `Host` h 8. Select **Deploy**. + + ## 2. Create an origin rule :::note If you are routing traffic to an object storage bucket, use [Cloud Connector](/rules/cloud-connector/) instead of an origin rule. ::: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain. 2. Go to **Rules** > **Overview**. 3. Select **Create rule** > **Origin Rule**. @@ -111,9 +117,11 @@ If you are routing traffic to an object storage bucket, use [Cloud Connector](/r 9. Select **Deploy**. + + ## Final remarks -After completing this setup, incoming traffic for `https:///uploads/*` will be routed to `https:///*`. +After completing this tutorial, incoming traffic for `https:///uploads/*` will be routed to `https:///*`. Ensure the filters for the [URL rewrite](/rules/transform/url-rewrite/) and the [origin rule](/rules/origin-rules/) (or [Cloud Connector](/rules/cloud-connector/) rule) are precise to avoid unintended rule executions. diff --git a/src/content/docs/rules/origin-rules/tutorials/point-to-pages-with-custom-domain.mdx b/src/content/docs/rules/origin-rules/tutorials/point-to-pages-with-custom-domain.mdx index 53ed8a3758ee0e..ee8a9c3b378c42 100644 --- a/src/content/docs/rules/origin-rules/tutorials/point-to-pages-with-custom-domain.mdx +++ b/src/content/docs/rules/origin-rules/tutorials/point-to-pages-with-custom-domain.mdx @@ -8,9 +8,9 @@ products: - Origin Rules --- -import { Example, DashButton } from "~/components"; +import { Example, DashButton, Steps } from "~/components"; -This example configures an origin rule and a DNS record to point to a Pages deployment with a custom domain. +This tutorial will instruct you how to configure an origin rule and a DNS record to point to a Pages deployment with a custom domain. The procedure will use the following example values: @@ -27,6 +27,8 @@ When configuring your Pages custom domain, use a custom domain that you do not p To add the custom domain to your Pages deployment: + + 1. In the Cloudflare dashboard, go to the **Workers & Pages** page. @@ -36,6 +38,8 @@ To add the custom domain to your Pages deployment: 4. Select **Set up a custom domain**. 5. Enter `blogmirror.example.com` and select **Continue**. + + When you add the custom domain to your Pages deployment, Cloudflare automatically creates a `CNAME` DNS record for the custom domain. ## 2. Create origin rule to rewrite host header and override DNS record @@ -69,6 +73,8 @@ In this example, the URL that website visitors will access starts with `/blog`. Use a URL rewrite to remove the `/blog` segment from the URL path. + + 1. Go to **Rules** > **Overview**. 2. Select **Create rule** > **URL Rewrite Rule**. 3. Enter a descriptive name for the rule in **Rule name**. @@ -89,6 +95,8 @@ Use a URL rewrite to remove the `/blog` segment from the URL path. 7. Select **Deploy**. + + :::note Cloudflare provides a rule template in the dashboard called **Rewrite Path for Object Storage Bucket** that you can use and adapt to configure the URL rewrite rule. ::: diff --git a/src/content/docs/rules/origin-rules/tutorials/point-to-r2-bucket-with-custom-domain.mdx b/src/content/docs/rules/origin-rules/tutorials/point-to-r2-bucket-with-custom-domain.mdx index b7e566ab252780..05489c9d2f5340 100644 --- a/src/content/docs/rules/origin-rules/tutorials/point-to-r2-bucket-with-custom-domain.mdx +++ b/src/content/docs/rules/origin-rules/tutorials/point-to-r2-bucket-with-custom-domain.mdx @@ -8,9 +8,9 @@ products: - Origin Rules --- -import { Example, DashButton } from "~/components"; +import { Example, DashButton, Steps } from "~/components"; -This example configures an origin rule and a DNS record to point to an R2 bucket configured with a custom domain. +This tutorial will instruct you how to configure an origin rule and a DNS record to point to an R2 bucket configured with a custom domain. The procedure will use the following example values: @@ -23,6 +23,8 @@ When configuring your R2 bucket's custom domain, use a custom domain that you do ## 1. Configure custom domain in your Pages project + + 1. In the Cloudflare dashboard, go to the **R2 object storage** page. @@ -33,6 +35,8 @@ When configuring your R2 bucket's custom domain, use a custom domain that you do 5. Enter the domain name you want to connect to — `imagesbucket.example.com` in this example — and select **Continue**. 6. Review the new record that will be added to the DNS table and select **Connect Domain**. + + Your domain is now connected. The status takes a few minutes to change from **Initializing** to **Active**, and you may need to refresh to review the status update. If the status has not changed, select the **...** next to your bucket and select **Retry connection**. To view the added DNS record, select **...** next to the connected domain and select **Manage DNS**. @@ -72,6 +76,8 @@ In our example, the URL that website visitors will access starts with `/images`. Use a URL rewrite to remove the `/images` segment from the URL path. Cloudflare provides a rule template in the dashboard called **Rewrite Path for Object Storage Bucket** that you can use to configure the required rewrite. + + 1. Go to **Rules** > **Overview**. 2. Select **Create rule** > **URL Rewrite Rule**. 3. Enter a descriptive name for the rule in **Rule name**. @@ -92,6 +98,8 @@ Use a URL rewrite to remove the `/images` segment from the URL path. Cloudflare 7. Select **Deploy**. + + :::note Cloudflare provides a rule template in the dashboard called **Rewrite Path for Object Storage Bucket** that you can use and adapt to configure the URL rewrite rule. ::: diff --git a/src/content/docs/rules/page-rules/how-to/url-forwarding.mdx b/src/content/docs/rules/page-rules/how-to/url-forwarding.mdx index 4835b506b95dc0..6af4d14cc3ca2f 100644 --- a/src/content/docs/rules/page-rules/how-to/url-forwarding.mdx +++ b/src/content/docs/rules/page-rules/how-to/url-forwarding.mdx @@ -9,7 +9,7 @@ head: content: URL forwarding | Page Rules --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; Page Rules allow you to forward or redirect traffic to a different URL, though they are just one of the [options provided by Cloudflare](/fundamentals/reference/redirects/). @@ -21,6 +21,8 @@ Page Rules allow you to forward or redirect traffic to a different URL, though t To configure URL forwarding or redirects using Page Rules: + + 1. Log in to your [Cloudflare account](https://dash.cloudflare.com), and select your account and domain. 2. Go to **Rules** > **Page Rules**. 3. Under **Page Rules**, select **Create Page Rule**. @@ -30,6 +32,8 @@ To configure URL forwarding or redirects using Page Rules: 7. Enter the destination URL. 8. Select **Save and Deploy Page Rule**. + + :::note Page Rules require a [proxied DNS record](/dns/proxy-status/) to work. Page Rules will not apply to subdomains that do not exist in DNS or are not being directed to Cloudflare. ::: diff --git a/src/content/docs/rules/page-rules/manage.mdx b/src/content/docs/rules/page-rules/manage.mdx index db0c5b7f2b4c95..b640828c6a0571 100644 --- a/src/content/docs/rules/page-rules/manage.mdx +++ b/src/content/docs/rules/page-rules/manage.mdx @@ -8,7 +8,7 @@ head: content: Manage | Page Rules --- -import { Render, TabItem, Tabs } from "~/components"; +import { Render, TabItem, Tabs, Steps } from "~/components"; You can manage Page Rules in the Cloudflare dashboard or via API. @@ -20,6 +20,8 @@ You can manage Page Rules in the Cloudflare dashboard or via API. To create a page rule in the dashboard: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com), and select your account and domain. 2. Go to **Rules** > **Page Rules**. 3. Select **Create Page Rule**. @@ -30,6 +32,8 @@ To create a page rule in the dashboard: + + For ideas about what rules you can create, refer to [recommended rules](/rules/page-rules/reference/recommended-rules/). @@ -53,12 +57,16 @@ You may also want to review the documentation on [wildcard matching](/rules/page To edit a page rule in the dashboard: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com), and select your account and domain. 2. Go to **Rules** > **Page Rules**. 3. For a specific rule: - To enable or disable the rule, select the on/off toggle. - To modify the URL pattern, settings, and order, select **Edit** (wrench icon). Then, enter the information you want to change. + + To update one or more fields using the API, send a [`PATCH` request](/api/resources/page_rules/methods/edit/). @@ -73,10 +81,14 @@ To entirely replace the configuration of a page rule, send a [`PUT` request](/ap To delete a page rule in the dashboard: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com), and select your account and domain. 2. Go to **Rules** > **Page Rules**. 3. For a specific rule, select **X**. Then, select **Delete**. + + To delete a page rule using the API, send a [`DELETE` request](/api/resources/page_rules/methods/delete/). diff --git a/src/content/docs/rules/page-rules/troubleshooting/billing-and-subscription.mdx b/src/content/docs/rules/page-rules/troubleshooting/billing-and-subscription.mdx index 8dd55e0d9c5755..bc6e475b3c8a60 100644 --- a/src/content/docs/rules/page-rules/troubleshooting/billing-and-subscription.mdx +++ b/src/content/docs/rules/page-rules/troubleshooting/billing-and-subscription.mdx @@ -7,7 +7,7 @@ head: content: Billing and subscription FAQ | Page Rules --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; @@ -19,14 +19,15 @@ No, you cannot buy additional Page Rules. You will need to [migrate to modern Ru To cancel a purchase: -1. Go to [your Account Subscriptions settings](http://dash.cloudflare.com/?to=/:account/billing/subscriptions). + +1. Go to [your Account Subscriptions settings](http://dash.cloudflare.com/?to=/:account/billing/subscriptions). 2. Find the associated website (listed in alphabetical order) and select **Edit**. - 3. For **Additional page rules**, change the amount to your previous value. If you are over your current limit, you may have to delete existing page rules (paused or active). - 4. Finish the updates to your subscription. + + ## When I change plans will I keep my add-on subscriptions? When you change plans, you will keep your Page Rules add-on subscription. diff --git a/src/content/docs/rules/reference/esc-deprecation.mdx b/src/content/docs/rules/reference/esc-deprecation.mdx index 0e5762dbc86166..63ba1270fcc789 100644 --- a/src/content/docs/rules/reference/esc-deprecation.mdx +++ b/src/content/docs/rules/reference/esc-deprecation.mdx @@ -8,6 +8,8 @@ head: content: Deprecation notice for Edge Side Code --- +import { Steps } from "~/components"; + **Edge Side Code (ESC) is now deprecated.** All configurations currently done via ESC are currently being removed. If you are still using ESC, you will need to configure other Cloudflare products to replace your current ESC configuration before this date. Edge Side Code was a customization option used by several Enterprise customers that allowed for more configurability of Cloudflare's global network features. This code could alter the behavior of Cloudflare's CDN, enabling logic for specific customer use cases. Currently, a few customers have ESC in place to perform special operations such as advanced header manipulation, host header switching. @@ -70,12 +72,16 @@ You can also configure a secret to perform per-request tests without changing th To disable/enable ESC for individual requests, do the following: + + 1. Create a secret (up to 100 characters) using the [Create ESC secret for a zone](#create-esc-secret-for-a-zone) or [Create ESC secret for an account](#create-esc-secret-for-an-account) operation. 2. Include the secret in your test requests using a cookie named `disable_esc`. This will only disable ESC for these test requests addressed at your zone or account, according to the endpoint scope you used in the previous step (zone or account). The following example HTTP request header defines a cookie for disabling ESC for the current request: `Cookie: disable_esc=` + + To change the ESC status for a zone, use the following operations: - [Disable ESC for a zone](#disable-esc-for-a-zone) diff --git a/src/content/docs/rules/reference/page-rules-migration.mdx b/src/content/docs/rules/reference/page-rules-migration.mdx index 8c9e2ff586a7f6..4e5111a0fe0d94 100644 --- a/src/content/docs/rules/reference/page-rules-migration.mdx +++ b/src/content/docs/rules/reference/page-rules-migration.mdx @@ -5,7 +5,7 @@ sidebar: order: 3 --- -import { Render, TabItem, Tabs, Example } from "~/components"; +import { Render, TabItem, Tabs, Example, Steps } from "~/components"; Cloudflare is continuously improving its platform to deliver more powerful and scalable tools for managing your configurations. To help you take full advantage of these improvements, we recommend using [modern Rules features](/rules/) for new implementations. These products address the limitations of Page Rules while providing greater flexibility, scalability, and ease of use. @@ -125,19 +125,23 @@ You configured a Page Rule to perform an automatic redirect from HTTP to HTTPS f **How to migrate**: + + 1. [Create a single redirect](/rules/url-forwarding/single-redirects/create-dashboard/) to always redirect HTTP requests to HTTPS. You can select the **Redirect from HTTP to HTTPS** rule template or enter the following rule configuration: -- **If incoming requests match**: Wildcard pattern - - **Request URL**: `http://*` -- **Then**: - - **Target URL**: `https://${1}` - - **Status code**: _301_ - - **Preserve query string**: Enabled + - **If incoming requests match**: Wildcard pattern + - **Request URL**: `http://*` + - **Then**: + - **Target URL**: `https://${1}` + - **Status code**: _301_ + - **Preserve query string**: Enabled 2. Turn off your existing Page Rule and validate the behavior of the redirect you created. 3. If your tests succeed, delete the existing Page Rule. + + | Page Rules configuration | Migrate to a single redirect | @@ -160,25 +164,25 @@ You configured a Page Rule turning on Automatic HTTPS Rewrites for all subdomain **How to migrate**: -1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to always rewrite HTTP links to HTTPS for any hostname containing `example.com`: + -
+1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to always rewrite HTTP links to HTTPS for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
+ - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
`(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Automatic HTTPS Rewrites - - **Value**: On - -
+ - **Then the settings are**: + - **Setting**: Automatic HTTPS Rewrites + - **Value**: On 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -201,28 +205,28 @@ You configured a Page Rule adjusting browser cache TTL to one day for all subdom **How to migrate**: -1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to adjust browser cache TTL for caching resources in the browser to one day for any hostname containing `example.com`: - -
+ -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache - - **Browser TTL**: Override origin and use this TTL - - **Input time-to-live (TTL)**: _1 day_ +1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to adjust browser cache TTL for caching resources in the browser to one day for any hostname containing `example.com`: -
+ - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Browser TTL**: Override origin and use this TTL + - **Input time-to-live (TTL)**: _1 day_ - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. + +
| Page Rules configuration | Migrate to a cache rule | @@ -245,21 +249,25 @@ You configured a Page Rule turning on Browser Integrity Check for all subdomains **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to turn on Browser Integrity Check for protecting against bots and threats for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Browser Integrity Check - - **Value**: On + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: Browser Integrity Check + - **Value**: On 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -282,22 +290,26 @@ You configured a Page Rule turning on Bypass Cache on Cookie for all subdomains **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to bypass cache for requests containing cookie `test_cookie` for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com" AND Cookie contains "test-cookie"` - - Using the Expression Editor:
- `(http.host contains "example.com" and http.cookie contains "test-cookie")` -- **Then**: - - **Cache eligibility**: Bypass cache + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com" AND Cookie contains "test-cookie"` + - Using the Expression Editor:
+ `(http.host contains "example.com" and http.cookie contains "test-cookie")` + - **Then**: + - **Cache eligibility**: Bypass cache - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -320,24 +332,28 @@ You configured a Page Rule turning on Cache By Device Type for all subdomains of **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to cache content based on user agent or device type for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache - - **Setting**: Cache key - - **Cache by device type**: On + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Setting**: Cache key + - **Cache by device type**: On - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -359,24 +375,28 @@ You configured a Page Rule turning on Cache Deception Armor for all subdomains o **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to protect against cache deception attacks for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache - - **Setting**: Cache key - - **Cache deception armor**: On + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Setting**: Cache key + - **Cache deception armor**: On - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -399,22 +419,27 @@ You configured a Page Rule turning on caching of all assets for all subdomains o **How to migrate**: + + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to adjust cache level for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -437,22 +462,26 @@ You configured a Page Rule turning on caching for responses that contained cooki **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to cache responses containing cookie `test_cookie` for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com" AND Cookie contains "test-cookie"` - - Using the Expression Editor:
- `(http.host contains "example.com" and http.cookie contains "test-cookie")` -- **Then**: - - **Cache eligibility**: Eligible for cache + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com" AND Cookie contains "test-cookie"` + - Using the Expression Editor:
+ `(http.host contains "example.com" and http.cookie contains "test-cookie")` + - **Then**: + - **Cache eligibility**: Eligible for cache - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -476,29 +505,33 @@ You configured a Page Rule turning on caching of every response with status code **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to cache responses with status code between `200` and `599` for one day for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` - - **Then**: - - **Cache eligibility**: Eligible for cache - - **Setting**: Edge TTL - - Use cache-control header if present, use default Cloudflare caching behavior if not - - **Status code TTL**: - - **Scope**: _Range_ - - **From**: _200_ - - **To**: _599_ - - **Duration**: _1 day_ - - + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Setting**: Edge TTL + - Use cache-control header if present, use default Cloudflare caching behavior if not + - **Status code TTL**: + - **Scope**: _Range_ + - **From**: _200_ + - **To**: _599_ + - **Duration**: _1 day_ + + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -521,24 +554,28 @@ You configured a Page Rule setting a custom cache key for all query string param **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to set a custom cache key for all query string parameters, for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache - - **Setting**: Cache key - - **Query string**: All query string parameters + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Setting**: Cache key + - **Query string**: All query string parameters - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -560,20 +597,24 @@ You configured a Page Rule turning off Cloudflare Apps (deprecated) for all subd **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to disable Cloudflare Apps (deprecated) for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Disable Apps + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: Disable Apps 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -601,22 +642,26 @@ You configured a Page Rule with **Disable Performance** (deprecated) for all sub **How to replace**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to disable Mirage, Polish, and Rocket Loader for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Mirage**: Off - - **Polish**: _Off_ - - **Rocket Loader**: Off + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Mirage**: Off + - **Polish**: _Off_ + - **Rocket Loader**: Off 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -646,6 +691,8 @@ This setting turned off a subset of Cloudflare security features: Email Obfuscat **How to replace**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to turn off one or more security features: - Email Obfuscation (part of [Cloudflare Scrape Shield](/waf/tools/scrape-shield/)) - Hotlink Protection (part of Cloudflare Scrape Shield) @@ -656,6 +703,8 @@ This setting turned off a subset of Cloudflare security features: Email Obfuscat 4. If your tests succeed, delete the existing Page Rule. + + :::caution If you are still using [WAF managed rules (previous version)](/waf/reference/legacy/old-waf-managed-rules/) or [Rate Limiting (previous version)](/waf/reference/legacy/old-rate-limiting/), consider upgrading to the new versions of these products. It is not possible to turn off these older products using modern Rules features. ::: @@ -675,20 +724,24 @@ You configured a Page Rule turning off [Zaraz](/zaraz/) for all subdomains of `e **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to turn off Zaraz for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Disable Zaraz + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: Disable Zaraz 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -711,25 +764,29 @@ You configured a Page Rule adjusting Edge Cache TTL for all subdomains of `examp **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to adjust edge cache TTL for caching resources on Cloudflare edge to one day, for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache - - **Setting**: Edge TTL - - Ignore cache-control header and use this TTL - - **Input time-to-live (TTL)**: _1 day_ + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Setting**: Edge TTL + - Ignore cache-control header and use this TTL + - **Input time-to-live (TTL)**: _1 day_ - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -752,21 +809,25 @@ You configured a Page Rule turning off [Email Obfuscation](/waf/tools/scrape-shi **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to turn off Email Obfuscation for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Email Obfuscation - - **Value**: Off + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: Email Obfuscation + - **Value**: Off 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -792,19 +853,23 @@ You configured a Page Rule permanently redirecting `www.example.com` to `example **How to migrate**: + + 1. [Create a single redirect](/rules/url-forwarding/single-redirects/create-dashboard/) to permanently redirect requests from `https://www.example.com` to `https://example.com`. You can select the **Redirect from WWW to Root** rule template or enter the following rule configuration: -- **If incoming requests match**: Wildcard pattern - - **Request URL**: `https://www.example.com/*` -- **Then**: - - **Target URL**: `https://example.com/${1}` - - **Status code**: _301_ - - **Preserve query string**: Enabled + - **If incoming requests match**: Wildcard pattern + - **Request URL**: `https://www.example.com/*` + - **Then**: + - **Target URL**: `https://example.com/${1}` + - **Status code**: _301_ + - **Preserve query string**: Enabled 2. Turn off your existing Page Rule and validate the behavior of the redirect you created. 3. If your tests succeed, delete the existing Page Rule. + + + 1. [Create a single redirect](/rules/url-forwarding/single-redirects/create-dashboard/) to permanently redirect requests for `example.com/old-path` to `example.com/new-path`: -- **If incoming requests match**: Wildcard pattern - - **Request URL**: `https://example.com/old-path/*` -- **Then**: - - **Target URL**: `https://example.com/new-path/${1}` - - **Status code**: _301_ - - **Preserve query string**: Enabled + - **If incoming requests match**: Wildcard pattern + - **Request URL**: `https://example.com/old-path/*` + - **Then**: + - **Target URL**: `https://example.com/new-path/${1}` + - **Status code**: _301_ + - **Preserve query string**: Enabled 2. Turn off your existing Page Rule and validate the behavior of the redirect you created. 3. If your tests succeed, delete the existing Page Rule. + + + 1. [Create an origin rule](/rules/origin-rules/create-dashboard/) changing the `Host` header to `example.saas-provider.com` for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Set origin parameters**: - - **Host Header** > **Rewrite to**: `example.saas-provider.com` + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Set origin parameters**: + - **Host Header** > **Rewrite to**: `example.saas-provider.com` 2. Turn off your existing Page Rule and validate the behavior of the origin rule you created. 3. If your tests succeed, delete the existing Page Rule. + +
| Page Rules configuration | Migrate to an origin rule | @@ -918,10 +991,14 @@ You configured a Page Rule adding a `CF-IPCountry` HTTP header, for all requests **How to migrate**: + + 1. [Turn on the **Add visitor location headers** Managed Transform](/rules/transform/managed-transforms/configure/) — a Transform Rules feature — to add the `CF-IPCountry` and other location headers to all requests. 2. Turn off your existing Page Rule and validate the behavior of the Managed Transform. 3. If your tests succeed, delete the existing Page Rule. + + | Page Rules configuration | Migrate to a Managed Transform | @@ -944,21 +1021,25 @@ You configured a Page Rule turning off Mirage for all subdomains of `example.com **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to turn off Mirage for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Mirage - - **Value**: Off + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: Mirage + - **Value**: Off 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -981,21 +1062,25 @@ You configured a Page Rule turning off Opportunistic Encryption for all subdomai **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to turn off Opportunistic Encryption for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Opportunistic Encryption - - **Value**: Off + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: Opportunistic Encryption + - **Value**: Off 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -1018,24 +1103,28 @@ You configured a Page Rule turning off Origin Cache Control for all subdomains o **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to determine edge cache behavior for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache - - **Setting**: Origin Cache Control - - **Enable Origin Cache Control**: Off + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Setting**: Origin Cache Control + - **Enable Origin Cache Control**: Off - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -1058,24 +1147,28 @@ You configured a Page Rule turning on Origin Error Page Pass-thru for all subdom **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to determine edge cache behavior for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache - - **Setting**: Origin error page pass-thru - - **Use Origin error page pass-thru**: On + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Setting**: Origin error page pass-thru + - **Use Origin error page pass-thru**: On - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -1098,21 +1191,25 @@ You configured a Page Rule turning off [Polish](/images/polish/) for all subdoma **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to turn off Polish for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Polish - - **Select value**: _Off_ + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: Polish + - **Select value**: _Off_ 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -1135,24 +1232,28 @@ You configured a Page Rule turning on Query String Sort for all subdomains of `e **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to sort query string parameters for caching purposes, for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache - - **Setting**: Cache key - - **Sort query string**: On + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Setting**: Cache key + - **Sort query string**: On - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -1175,20 +1276,24 @@ You configured a Page Rule changing the origin to `example.saas-provider.com`, f **How to migrate**: + + 1. [Create an origin rule](/rules/origin-rules/create-dashboard/) overriding the origin to `example.saas-provider.com` for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **DNS Record** > **Override to**: `example.saas-provider.com` + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **DNS Record** > **Override to**: `example.saas-provider.com` 2. Turn off your existing Page Rule and validate the behavior of the origin rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to an origin rule | @@ -1211,24 +1316,28 @@ You configured a Page Rule turning on byte-for-byte equivalency checks for all s **How to migrate**: + + 1. [Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to respect strong ETags for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then**: - - **Cache eligibility**: Eligible for cache - - **Setting**: Respect strong ETags - - **Use strong ETag headers**: On + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then**: + - **Cache eligibility**: Eligible for cache + - **Setting**: Respect strong ETags + - **Use strong ETag headers**: On - + 2. Turn off your existing Page Rule and validate the behavior of the cache rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a cache rule | @@ -1251,21 +1360,25 @@ You configured a Page Rule turning off Rocket Loader for all subdomains of `exam **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to turn off Rocket Loader for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Rocket Loader - - **Value**: Off + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: Rocket Loader + - **Value**: Off 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -1288,21 +1401,25 @@ You configured a Page Rule setting Security Level to _I'm Under Attack_ for all **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to set Security Level to _I'm Under Attack_, for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: Security Level - - **Select Security Level**: _I'm Under Attack_ + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: Security Level + - **Select Security Level**: _I'm Under Attack_ 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | @@ -1325,10 +1442,14 @@ You configured a Page Rule adding a `True-Client-IP` HTTP header for all request **How to migrate**: + + 1. [Turn on the **Add "True-Client-IP" header** Managed Transform](/rules/transform/managed-transforms/configure/) — a Transform Rules feature — to add the `True-Client-IP` header to all requests. 2. Turn off your existing Page Rule and validate the behavior of the Managed Transform. 3. If your tests succeed, delete the existing Page Rule. + + | Page Rules configuration | Migrate to a Managed Transform | @@ -1351,21 +1472,25 @@ You configured a Page Rule setting SSL to _Strict_ for all subdomains of `exampl **How to migrate**: + + 1. [Create a configuration rule](/rules/configuration-rules/create-dashboard/) to set SSL to _Strict_, for any hostname containing `example.com`: -- **When incoming requests match**: Custom filter expression - - Using the Expression Builder:
- `Hostname contains "example.com"` - - Using the Expression Editor:
- `(http.host contains "example.com")` -- **Then the settings are**: - - **Setting**: SSL - - **Select SSL/TLS encryption mode**: _Strict_ + - **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname contains "example.com"` + - Using the Expression Editor:
+ `(http.host contains "example.com")` + - **Then the settings are**: + - **Setting**: SSL + - **Select SSL/TLS encryption mode**: _Strict_ 2. Turn off your existing Page Rule and validate the behavior of the configuration rule you created. 3. If your tests succeed, delete the existing Page Rule. +
+
| Page Rules configuration | Migrate to a configuration rule | diff --git a/src/content/docs/rules/snippets/create-dashboard.mdx b/src/content/docs/rules/snippets/create-dashboard.mdx index 2d2a2dfa2dc33f..051cb9aa79b918 100644 --- a/src/content/docs/rules/snippets/create-dashboard.mdx +++ b/src/content/docs/rules/snippets/create-dashboard.mdx @@ -9,7 +9,9 @@ head: content: Create a snippet in the dashboard --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website. @@ -34,3 +36,5 @@ import { Render } from "~/components"; 10. To deploy your snippet, select **Deploy**. If you are not ready to deploy your snippet, open the dropdown next to **Deploy** and select **Save as Draft**. + + \ No newline at end of file diff --git a/src/content/docs/rules/trace-request/how-to.mdx b/src/content/docs/rules/trace-request/how-to.mdx index 277c7d827c1acc..58d3810cf62821 100644 --- a/src/content/docs/rules/trace-request/how-to.mdx +++ b/src/content/docs/rules/trace-request/how-to.mdx @@ -11,17 +11,23 @@ head: description: Learn how to use Cloudflare Trace in the dashboard and with the API. --- -import { GlossaryTooltip, DashButton } from "~/components"; +import { GlossaryTooltip, DashButton, Steps } from "~/components"; ## Use Trace in the dashboard ### 1. Configure one or more Cloudflare products + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com), and select your account. 2. Set configuration settings at the account level, or select a domain and configure settings for one or more Cloudflare products. + + ### 2. Build a trace + + 1. In the Cloudflare dashboard, go to the **Trace** page. @@ -41,23 +47,33 @@ import { GlossaryTooltip, DashButton } from "~/components"; 5. Select **Send Trace**. + + ### 3. Assess results The **Trace results** page shows all evaluated and executed configurations from different Cloudflare products, in evaluation order. Any inactive rules are not evaluated. + + 1. Analyze the different [steps](#steps-in-trace-results) with evaluated and executed configurations for the current trace. Trace results include matches for all active rules and configurations, whether configured at the account level or for a specific domain or subdomain. To show all configurations, including the ones that did not match the request, select _All configurations_ in the **Results shown** dropdown. 2. (Optional) Update your Cloudflare configuration (at the account or at the domain/subdomain level) and create a new trace to check the impact of your changes. + + ### 4. (Optional) Save the trace configuration To run a trace later with the same configuration: + + 1. Copy the JSON shown in the dashboard with the current trace configuration. 2. When creating a new trace, paste it in the JSON box to define all the settings of the new trace. + + ## Use Trace via API Use the [Request Trace](/api/resources/request_tracers/subresources/traces/methods/create/) operation to perform a trace using the Cloudflare API. diff --git a/src/content/docs/rules/transform/managed-transforms/configure.mdx b/src/content/docs/rules/transform/managed-transforms/configure.mdx index 514b7566dc4d67..440feebb746d25 100644 --- a/src/content/docs/rules/transform/managed-transforms/configure.mdx +++ b/src/content/docs/rules/transform/managed-transforms/configure.mdx @@ -6,16 +6,20 @@ sidebar: description: Learn how to configure Managed Transforms. --- -import { Details, TabItem, Tabs, Render, APIRequest } from "~/components"; +import { Details, TabItem, Tabs, Render, Steps, APIRequest } from "~/components"; + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website. 2. Go to **Rules** > **Settings**. 3. In the **Managed Transforms** tab, enable or disable the [desired Managed Transforms](/rules/transform/managed-transforms/reference/) by selecting the toggle next to each entry. Some Managed Transforms may not be available in your Cloudflare plan or product subscriptions. + + **1. Get list of available Managed Transforms** diff --git a/src/content/docs/rules/transform/request-header-modification/create-dashboard.mdx b/src/content/docs/rules/transform/request-header-modification/create-dashboard.mdx index 23117f6d54ddc2..c606dea0c93b74 100644 --- a/src/content/docs/rules/transform/request-header-modification/create-dashboard.mdx +++ b/src/content/docs/rules/transform/request-header-modification/create-dashboard.mdx @@ -6,12 +6,14 @@ sidebar: label: Create a rule in the dashboard --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; Refer to the [Rules examples gallery](/rules/transform/examples/?operation=Request+modification) for examples of rule definitions. To create a rule: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website. 2. Go to **Rules** > **Overview**. @@ -46,3 +48,5 @@ To create a rule: 11. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**. + + \ No newline at end of file diff --git a/src/content/docs/rules/transform/response-header-modification/create-dashboard.mdx b/src/content/docs/rules/transform/response-header-modification/create-dashboard.mdx index 3a896c388c8aea..c961f928c52ae5 100644 --- a/src/content/docs/rules/transform/response-header-modification/create-dashboard.mdx +++ b/src/content/docs/rules/transform/response-header-modification/create-dashboard.mdx @@ -6,12 +6,14 @@ sidebar: label: Create a rule in the dashboard --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; Refer to the [Rules examples gallery](/rules/transform/examples/?operation=Response+modification) for examples of rule definitions. To create a rule: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website. 2. Go to **Rules** > **Overview**. @@ -48,3 +50,5 @@ To create a rule: 11. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**. + + \ No newline at end of file diff --git a/src/content/docs/rules/transform/url-rewrite/create-dashboard.mdx b/src/content/docs/rules/transform/url-rewrite/create-dashboard.mdx index d07b0c105ed224..a6cd70c8c89e03 100644 --- a/src/content/docs/rules/transform/url-rewrite/create-dashboard.mdx +++ b/src/content/docs/rules/transform/url-rewrite/create-dashboard.mdx @@ -6,12 +6,14 @@ sidebar: label: Create a rule in the dashboard --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; Refer to the [Rules examples gallery](/rules/transform/examples/?operation=Rewrite+URL) for examples of rule definitions. To create a rule: + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and website. 2. Go to **Rules** > **Overview**. @@ -50,6 +52,8 @@ To create a rule: + + ## Wildcard pattern parameters The Cloudflare dashboard offers a simplified user interface for creating URL rewrites based on wildcard matching and replacement. When you select **Wildcard pattern**, you will have the following parameters available: diff --git a/src/content/docs/rules/url-forwarding/bulk-redirects/create-api.mdx b/src/content/docs/rules/url-forwarding/bulk-redirects/create-api.mdx index b35fe826eb6035..0d3fe311fb89c3 100644 --- a/src/content/docs/rules/url-forwarding/bulk-redirects/create-api.mdx +++ b/src/content/docs/rules/url-forwarding/bulk-redirects/create-api.mdx @@ -7,14 +7,18 @@ sidebar: description: Learn how to create Bulk Redirects using the Cloudflare API. --- -import { Render, APIRequest } from "~/components"; +import { Render, Steps, APIRequest } from "~/components"; To create Bulk Redirects via API, you must: + + 1. Create a Bulk Redirect List via API. 2. Add items (URL redirects) to the list created in step 1. 3. Create a Bulk Redirect Rule via API, which enables the list created in step 1. + + + 1. Create a Bulk Redirect List with one or more URL redirects. 2. Create a Bulk Redirect Rule to enable the URL redirects in the list. + + You can create Bulk Redirect Lists and Bulk Redirect Rules in the Cloudflare dashboard: - At the account level, in **Bulk redirects**. @@ -30,6 +34,8 @@ However, the lists and rules only exist at the account level and every zone in t {/* prettier-ignore-start */} + + 1. In the Cloudflare dashboard, go to the **Bulk redirects** page. @@ -70,6 +76,8 @@ However, the lists and rules only exist at the account level and every zone in t 6. Select **Continue to Redirect Rules** to go to the rule creation page, and follow the instructions in the next section. You must create a Bulk Redirect Rule to enable the URL redirects you defined. + + {/* prettier-ignore-end */} :::note[Notes] @@ -80,6 +88,8 @@ However, the lists and rules only exist at the account level and every zone in t ## 2. Create a Bulk Redirect Rule + + 1. (Optional) If you are not using the Bulk Redirect List creation wizard according to the instructions in the previous section: 1. In the Cloudflare dashboard, go to the **Bulk redirects** page. @@ -96,3 +106,5 @@ However, the lists and rules only exist at the account level and every zone in t 5. To save and deploy the Bulk Redirect Rule, select **Save and Deploy**. If you are not ready to deploy your rule, select **Save as Draft**. + + \ No newline at end of file diff --git a/src/content/docs/rules/url-forwarding/examples/redirect-all-another-domain.mdx b/src/content/docs/rules/url-forwarding/examples/redirect-all-another-domain.mdx index 2187307c4010c3..e8f71be4fc80ff 100644 --- a/src/content/docs/rules/url-forwarding/examples/redirect-all-another-domain.mdx +++ b/src/content/docs/rules/url-forwarding/examples/redirect-all-another-domain.mdx @@ -11,17 +11,23 @@ description: Create a redirect rule to redirect all requests to a different service (port 80). --- +import { Steps } from "~/components"; + In this example the original domain was replaced with a different domain. All functionality was maintained, except for the HTTP service (port 80) which was discontinued. + + 1. Create a Bulk Redirect List with the following URL redirect: -- **Source URL**: `example.com/` -- **Target URL**: `https://example.net/` -- **Subpath matching**: Enabled -- **Preserve query string**: Enabled + - **Source URL**: `example.com/` + - **Target URL**: `https://example.net/` + - **Subpath matching**: Enabled + - **Preserve query string**: Enabled 2. Create a Bulk Redirect Rule that enables this list. + + This configuration will perform the following redirects: | Request URL | URL after redirect | diff --git a/src/content/docs/rules/url-forwarding/examples/redirect-all-country.mdx b/src/content/docs/rules/url-forwarding/examples/redirect-all-country.mdx index 62005345254a23..def38402fc261e 100644 --- a/src/content/docs/rules/url-forwarding/examples/redirect-all-country.mdx +++ b/src/content/docs/rules/url-forwarding/examples/redirect-all-country.mdx @@ -11,8 +11,12 @@ description: Create a redirect rule to redirect all website visitors from the the same paths. --- +import { Steps } from "~/components"; + In this example, all website visitors from the United Kingdom will be redirected to a different domain, but maintaining current functionality in the same paths. + + 1. Create a Bulk Redirect List named `uk_redirect_list` with the following URL redirect: - **Source URL**: `https://example.com/` @@ -26,6 +30,8 @@ In this example, all website visitors from the United Kingdom will be redirected ip.src.country == "GB" and http.request.full_uri in $uk_redirect_list ``` + + This configuration will perform the following redirects for UK visitors: | Request URL | URL after redirect | diff --git a/src/content/docs/rules/url-forwarding/examples/redirect-all-different-domain-root.mdx b/src/content/docs/rules/url-forwarding/examples/redirect-all-different-domain-root.mdx index 2cb68487172ef0..cd77b921e74f59 100644 --- a/src/content/docs/rules/url-forwarding/examples/redirect-all-different-domain-root.mdx +++ b/src/content/docs/rules/url-forwarding/examples/redirect-all-different-domain-root.mdx @@ -9,8 +9,12 @@ description: Create a redirect rule to redirect all URLs for a domain to point to the root of a new domain, including any subdomains of the old domain. --- +import { Steps } from "~/components"; + In this example, an old website was discontinued and replaced by a new one in a different domain. The functionality is different, and all URLs should now point to the root of the new domain. The same applies to any subdomains of the old domain. + + 1. Create a Bulk Redirect List with the following URL redirect: - **Source URL**: `example.com/` @@ -21,6 +25,8 @@ In this example, an old website was discontinued and replaced by a new one in a 2. Create a Bulk Redirect Rule that enables this list. + + This configuration will perform the following redirects: | Request URL | URL after redirect | diff --git a/src/content/docs/rules/url-forwarding/single-redirects/create-dashboard.mdx b/src/content/docs/rules/url-forwarding/single-redirects/create-dashboard.mdx index 7ea07d1d1db6e9..e9a06eb9ebe5b5 100644 --- a/src/content/docs/rules/url-forwarding/single-redirects/create-dashboard.mdx +++ b/src/content/docs/rules/url-forwarding/single-redirects/create-dashboard.mdx @@ -6,7 +6,9 @@ sidebar: label: Create rule in the dashboard --- -import { Render } from "~/components"; +import { Render, Steps } from "~/components"; + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account and domain. 2. Go to **Rules** > **Overview**. @@ -29,6 +31,8 @@ import { Render } from "~/components"; + +