Skip to content

Commit 0cd76dc

Browse files
pedrosousaclaude
authored andcommitted
[Rules] Update Error Pages (#26357)
* Update Error Pages * Improve linking
1 parent 4f5c50a commit 0cd76dc

File tree

3 files changed

+46
-17
lines changed

3 files changed

+46
-17
lines changed

src/content/docs/rules/custom-errors/edit-error-pages.mdx

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,34 @@ sidebar:
55
order: 2
66
---
77

8-
import { Details, DashButton, Steps } from "~/components";
8+
import { Details, DashButton, Steps, Tabs, TabItem } from "~/components";
99

10-
## Before you start
10+
You can define custom [Error Pages](/rules/custom-errors/#error-pages) for the following errors and challenges:
11+
12+
- WAF block
13+
- IP/Country block
14+
- IP/Country challenge
15+
- 500 class errors
16+
- 1000 class errors
17+
- Managed challenge / I'm Under Attack Mode
18+
- Rate limiting block
19+
20+
<Details header="Older error page types">
21+
22+
You can only customize the error pages for the following error page types if you have customized their error pages in the past:
23+
24+
- Interactive Challenge
25+
- JavaScript Challenge
26+
27+
These types of challenges are being discouraged in favor of managed challenges.
28+
29+
</Details>
30+
31+
For more information on the different types of Error Pages, refer to [Error page types](/rules/custom-errors/reference/error-page-types/).
32+
33+
To return custom error responses for requests that match specific conditions, use [Custom Error Rules](/rules/custom-errors/#custom-error-rules) instead.
34+
35+
## 1. Design your custom error page
1136

1237
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/).
1338

@@ -55,45 +80,49 @@ The following HTML code is an example error page for 5XX errors without styling:
5580

5681
---
5782

58-
## Update an error page in the dashboard
83+
## 2. Update an error page in the dashboard
5984

60-
### Account-level custom error page
85+
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.
6186

62-
To update an account-level custom error page:
87+
<Tabs> <TabItem label="Zone level">
88+
89+
To edit a zone-level custom error page:
6390

6491
<Steps>
6592

66-
1. In the Cloudflare dashboard, go to the **Settings** page.
93+
1. In the Cloudflare dashboard, go to the **Error Pages** page.
6794

68-
<DashButton url="/?to=/:account/configurations" />
95+
<DashButton url="/?to=/:account/:zone/error-pages" />
6996

70-
2. Go to **Error Pages** and identify your desired custom error page type.
97+
2. Identify your desired custom error page type.
7198
3. (Optional) To preview the current error page (default or custom), select the link in the **Show** column.
7299
4. To edit the error page, select the three dots > **Edit** next to the page type you previously identified.
73100
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.
74101
6. Select **Confirm**.
75102

76103
</Steps>
77104

78-
### Zone-level custom error page
105+
</TabItem> <TabItem label="Account level">
79106

80-
To edit a zone-level custom error page:
107+
To update an account-level custom error page:
81108

82109
<Steps>
83110

84-
1. In the Cloudflare dashboard, go to the **Error Pages** page.
111+
1. In the Cloudflare dashboard, go to the **Settings** page.
85112

86-
<DashButton url="/?to=/:account/:zone/error-pages" />
113+
<DashButton url="/?to=/:account/configurations" />
87114

88-
2. Identify your desired custom error page type.
115+
2. Go to **Error Pages** and identify your desired custom error page type.
89116
3. (Optional) To preview the current error page (default or custom), select the link in the **Show** column.
90117
4. To edit the error page, select the three dots > **Edit** next to the page type you previously identified.
91118
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.
92119
6. Select **Confirm**.
93120

94121
</Steps>
95122

96-
### Fetch custom error page again
123+
</TabItem> </Tabs>
124+
125+
## Fetch custom error page again
97126

98127
After successfully setting the content of the custom error page in **Error Pages**, you can remove the page from your origin server.
99128

src/content/docs/rules/custom-errors/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ A custom error asset corresponds to a web resource such as an HTML web page (inc
8484

8585
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.
8686

87-
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).
87+
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).

src/content/docs/rules/custom-errors/reference/parameters.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Type, MetaInfo } from "~/components";
1212

1313
## Custom error rules
1414

15-
Custom error rules define when a custom error gets triggered and the content that is served to visitors. Rule parameters are the following:
15+
[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:
1616

1717
### Response type
1818

@@ -71,7 +71,7 @@ If you create an HTML error response, make sure the `referrer` meta tag is not p
7171

7272
## Custom error assets
7373

74-
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.
74+
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.
7575

7676
Custom error assets have the following parameters:
7777

0 commit comments

Comments
 (0)