From 162aa875170a67ac10bad023bbaec6de0d9cac96 Mon Sep 17 00:00:00 2001 From: Pedro Sousa <680496+pedrosousa@users.noreply.github.com> Date: Thu, 6 Nov 2025 19:35:08 +0000 Subject: [PATCH 1/2] [Rules] Update Error Pages --- .../rules/custom-errors/edit-error-pages.mdx | 57 ++++++++++++++----- 1 file changed, 43 insertions(+), 14 deletions(-) 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 8879b128a7b25a2..083b9e34deab2aa 100644 --- a/src/content/docs/rules/custom-errors/edit-error-pages.mdx +++ b/src/content/docs/rules/custom-errors/edit-error-pages.mdx @@ -5,9 +5,34 @@ sidebar: order: 2 --- -import { Details, DashButton, Steps } from "~/components"; +import { Details, DashButton, Steps, Tabs, TabItem } from "~/components"; -## Before you start +You can define custom [Error Pages](/rules/custom-errors/#error-pages) for the following errors and challenges: + +- WAF block +- IP/Country block +- IP/Country challenge +- 500 class errors +- 1000 class errors +- Managed challenge / I'm Under Attack Mode +- Rate limiting block + +
+ +You can only customize the error pages for the following error page types if you have customized their error pages in the past: + +- Interactive Challenge +- JavaScript Challenge + +These types of challenges are being discouraged in favor of managed challenges. + +
+ +For more information on the different types of Error Pages, refer to [Error page types](/rules/custom-errors/reference/error-page-types/). + +To return custom error responses for requests that match specific conditions, use [Custom Error Rules](/rules/custom-errors/#custom-error-rules) instead. + +## 1. Design your custom error page Before defining a custom error page in your Cloudflare account, you will need to design and code that page. It can be hosted on your own web server or using a Cloudflare product like [Snippets](/rules/snippets/). @@ -55,19 +80,21 @@ The following HTML code is an example error page for 5XX errors without styling: --- -## Update an error page in the dashboard +## 2. Update an error page in the dashboard -### Account-level custom error page +You can define an error page at the zone level or for your entire account. Zone-level error pages have priority over account-level error pages. -To update an account-level custom error page: + + +To edit a zone-level custom error page: -1. In the Cloudflare dashboard, go to the **Settings** page. +1. In the Cloudflare dashboard, go to the **Error Pages** page. - + -2. Go to **Error Pages** and identify your desired custom error page type. +2. 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. 4. To edit the error page, select the three dots > **Edit** next to the page type you previously identified. 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. @@ -75,17 +102,17 @@ To update an account-level custom error page: -### Zone-level custom error page + -To edit a zone-level custom error page: +To update an account-level custom error page: -1. In the Cloudflare dashboard, go to the **Error Pages** page. +1. In the Cloudflare dashboard, go to the **Settings** page. - + -2. Identify your desired custom error page type. +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. 4. To edit the error page, select the three dots > **Edit** next to the page type you previously identified. 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. @@ -93,7 +120,9 @@ To edit a zone-level custom error page: -### Fetch custom error page again + + +## 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. From 9aea2365f7c7b3121777cfa47119341b960605fe Mon Sep 17 00:00:00 2001 From: Pedro Sousa <680496+pedrosousa@users.noreply.github.com> Date: Thu, 6 Nov 2025 19:35:34 +0000 Subject: [PATCH 2/2] Improve linking --- src/content/docs/rules/custom-errors/index.mdx | 2 +- src/content/docs/rules/custom-errors/reference/parameters.mdx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/docs/rules/custom-errors/index.mdx b/src/content/docs/rules/custom-errors/index.mdx index 4aba64fc3b4300b..7b746c097969832 100644 --- a/src/content/docs/rules/custom-errors/index.mdx +++ b/src/content/docs/rules/custom-errors/index.mdx @@ -84,4 +84,4 @@ A custom error asset corresponds to a web resource such as an HTML web page (inc Once the custom error asset is stored in Cloudflare's global network, the URL you initially provided no longer needs to be available. You can update an existing custom error asset by fetching it again. The metadata associated with each custom error asset includes the timestamp when the last fetch occurred, and this information is displayed in the dashboard. -You can use a custom error asset in one or more custom error rules in the same scope where you defined the asset (zone or account). +You can use a custom error asset in one or more [custom error rules](#custom-error-rules) in the same scope where you defined the asset (zone or account). diff --git a/src/content/docs/rules/custom-errors/reference/parameters.mdx b/src/content/docs/rules/custom-errors/reference/parameters.mdx index c62b378cc7ea4e4..65282a557dc3cba 100644 --- a/src/content/docs/rules/custom-errors/reference/parameters.mdx +++ b/src/content/docs/rules/custom-errors/reference/parameters.mdx @@ -12,7 +12,7 @@ import { Type, MetaInfo } from "~/components"; ## Custom error rules -Custom error rules define when a custom error gets triggered and the content that is served to visitors. Rule parameters are the following: +[Custom error rules](/rules/custom-errors/#custom-error-rules) define when a custom error gets triggered and the content that is served to visitors. Rule parameters are the following: ### Response type @@ -71,7 +71,7 @@ If you create an HTML error response, make sure the `referrer` meta tag is not p ## Custom error assets -A custom error asset corresponds to a web resource such as an HTML web page (including any referenced images, CSS, and JavaScript code) that Cloudflare fetches and saves based on a URL you provide, to be served to visitors as an error page. +A [custom error asset](/rules/custom-errors/#custom-error-assets) corresponds to a web resource such as an HTML web page (including any referenced images, CSS, and JavaScript code) that Cloudflare fetches and saves based on a URL you provide, to be served to visitors as an error page. Custom error assets have the following parameters: