Cloudflare は、設定管理向けにより強力でスケーラブルなツールを提供できるよう、プラットフォームを継続的に改善しています。これらの改善を活かすため、新規の実装では 現行の Rules 機能 を使うことをおすすめします。これらの製品は Page Rules の制約を解消し、柔軟性、スケーラビリティ、使いやすさを高めます。
まず始めるには、Cloudflare ダッシュボードの Rules > Overview にあるワンクリックテンプレートを見てください。リダイレクト、リライト、ヘッダー変更などのよくある設定を簡単にでき、セットアップが速くなります。
移行をスムーズにするため、既存の Page Rules の移行は Cloudflare が自動で行います。この処理は 2025 年後半以降を予定しており、利用者側の操作は不要です。変更の前には事前通知があります。
現行の Rules 機能の利点を先に使いたい場合は、今すぐ導入を始められます。早めに導入すると、次ができます。
- 現行機能をより早く使える。
- 変化する要件に合わせてルールを調整できる。
このガイドでは、この作業を助けるため、Page Rules の設定と現行の Rules 製品の対応関係を示します。
Cloudflare Page Rules には根本的な制約があります。URL パターンだけで発火すること、パフォーマンス上の理由でゾーンあたり 125 ルールまでであること、などです。同じ受信リクエストに複数の Page Rule が当たると、デバッグも複雑です。
2022 年、ブログ投稿 The future of Page Rules ↗ で、Page Rules を専用製品群に置き換えると発表しました。各製品は用途に特化し、利用者により多くの制御を渡します。新しい Rules 製品 — Configuration Rules、Compression Rules、Origin Rules、Redirects、Transform Rules — は一般提供(GA)済みで、すでに数万の Cloudflare 顧客が使っています。
現行の Rules 機能の改善点は次のとおりです。
- 新しいエンジン: 新しい Rules 機能は Ruleset Engine で動きます。多くの HTTP リクエスト / レスポンスフィールドを扱う堅牢な言語で、柔軟に設定できます。
- スケーラビリティの向上: スケーラビリティが上がったため、Cloudflare プランのクォータも増えています。
- トラブルシューティングの容易さ: 各ルールが独立して動くため、実行結果を予測しやすく、切り分けが簡単です。さらに Cloudflare Trace で、ルール同士の相互作用を確認できます。
- 一貫性の向上: 現行の Rules 機能は、製品間で共通のフィールドと機能を持ち、操作感と Terraform 設定の予測しやすさが揃っています。
Rules 機能の評価と実行順序は、Page Rules と異なります。
- ルールの一致ロジック: Page Rules は、最初に一致したルールだけを適用します(先勝ち)。現行の Rules は積み重ね可能で、複数の一致ルールを組み合わせて同じリクエストに適用できます(後勝ち)。たとえば同じ URL に複数の Cache Rules が一致すると、それらの機能が順にすべて適用されます。
- アクションの分離: Page Rule には、複数製品向けの複数アクションを含め、Page Rule 内で利用者が選んだ順に適用できます。現行の Rules 機能は 固定の順 で評価され、利用者は製品の フェーズ 内でのルール順を定義します。
- 優先度: 現行の Rules 機能は Page Rules より優先されます。たとえば同じパスのキャッシュ設定を両方で定義した場合、Cache Rules が Page Rules を上書きします。
- キャッシュの動作: Cache Rules で Eligible for cache を選ぶと、デフォルトで Cache Everything が有効になります。Page Rules とまったく同じ動作にするには、設定の調整 が必要になることがあります。
- Workers との相互作用: Workers が処理したリクエストは Page Rules のアクションを抑制しますが、現行の Rules 機能のアクションは抑制しません。
現行の Rules は、URL パターンではなくフィルター式を使います。Rules 言語で作るこれらの式は、フィールド、関数、演算子 を使い、より精密に一致させられます。
次の例は、http.request.full_uri フィールドと、ワイルドカード一致 用の wildcard 演算子の使い方です。
Page Rules の URL の例:
example.com/*/downloads/*.txt
これは、次のような フィルター式 になります。
http.request.full_uri wildcard "http*://example.com/*/downloads/*.txt*"
Single Redirects と URL Rewrite Rules には、Wildcard pattern という簡易ビューもあります。完全なフィルター式(http.request.full_uri wildcard "http*://example.com/*/downloads/*.txt*")を書かずに、URL パターン(http*://example.com/*/downloads/*.txt*)だけを指定できます。
- プロトコルスキーム: Page Rules の URL 一致は、ルールに明示しない限り URI スキーム(
http://やhttps://など)を含みません。一方、http.request.full_uriフィールドを使うフィルター式は、プロトコルスキームを含む完全な URI の一致が必要です。スキームを問わないフィルター式にするには、http://とhttps://の両方に合うワイルドカードとしてhttp*://を使います。 - クエリ文字列: Page Rules は、ルール URL の一部でない限りクエリ文字列を無視します。フィルター式は、
http.request.full_uriフィールドの一部としてクエリ文字列を自動で含みます。クエリ文字列が一致に影響しないようにするには、フィルター式の末尾に*ワイルドカードを付けます(.txt*など)。
既存の Page Rules を現行の Rules 製品へ対応づけるため、この表は Page Rules の設定が現行の Rules にどう移るかと、よくある設定の例を示します。
また、よくある設定を速くできるように、Cloudflare ダッシュボードの Rules > Overview には、ワンクリックテンプレートが多数あります。リダイレクト、リライト、ヘッダー変更など、よく使う機能を、あらかじめ入ったフィルター式とアクションですぐにデプロイできます。セットアップを速くするため、ダッシュボードでこれらのテンプレートを確認してください。
| Page Rules の設定 | 新しい実装で使うもの | 移行 / 置き換えの手順 |
|---|---|---|
| Always Use HTTPS | Redirect Rules (Single Redirects) | Always Use HTTPS を移行する |
| Browser Cache TTL | Cache Rules | Browser Cache TTL を移行する |
| Browser Integrity Check | Configuration Rules | Browser Integrity Check を移行する |
| Bypass Cache on Cookie | Cache Rules | Bypass Cache on Cookie を移行する |
| Cache By Device Type | Cache Rules | Cache By Device Type を移行する |
| Cache Deception Armor | Cache Rules | Cache Deception Armor を移行する |
| Cache Level | Cache Rules | Cache Level を移行する |
| Cache on Cookie | Cache Rules | Cache on Cookie を移行する |
| Cache TTL by status code | Cache Rules | Cache TTL by status code を移行する |
| Custom Cache Key | Cache Rules | Custom Cache Key を移行する |
| Disable Apps | Configuration Rules | Disable Apps を移行する |
| Disable Performance | なし(非推奨) | Disable Performance を置き換える |
| Disable Railgun | なし(非推奨) | なし |
| Disable Security | なし(非推奨) | Disable Security を置き換える |
| Disable Zaraz | Configuration Rules | Disable Zaraz を移行する |
| Edge Cache TTL | Cache Rules | Edge Cache TTL を移行する |
| Email Obfuscation | Configuration Rules | Email Obfuscation を移行する |
| Forwarding URL | Redirect Rules (Single Redirects) | Forwarding URL を移行する |
| Host Header Override | Origin Rules | Host Header Override を移行する |
| IP Geolocation Header | Transform Rules (Managed Transforms) | IP Geolocation Header を移行する |
| Opportunistic Encryption | Configuration Rules | Opportunistic Encryption を移行する |
| Origin Cache Control | Cache Rules | Origin Cache Control を移行する |
| Origin Error Page Pass-thru | Cache Rules | Origin Error Page Pass-thru を移行する |
| Polish | Configuration Rules | Polish を移行する |
| Query String Sort | Cache Rules | Query String Sort を移行する |
| Resolve Override | Origin Rules | Resolve Override を移行する |
| Respect Strong ETags | Cache Rules | Respect Strong ETags を移行する |
| Response Buffering | なし(非推奨) | なし |
| Rocket Loader | Configuration Rules | Rocket Loader を移行する |
| Security Level | Configuration Rules | Security Level を移行する |
| True Client IP Header | Transform Rules (Managed Transforms) | True Client IP Header を移行する |
| SSL | Configuration Rules | SSL を移行する |
| Web Application Firewall | なし(非推奨) | なし |
前提:
example.com の全サブドメインと example.com 自身について、HTTP から HTTPS へ自動リダイレクトする Page Rule を設定しています。
- URL
*example.com/* - Setting: Always Use HTTPS
移行方法:
-
HTTP リクエストを常に HTTPS へリダイレクトする Single Redirect を作成 します。Redirect from HTTP to HTTPS ルールテンプレートを選ぶか、次のルール設定を入力します。
- If incoming requests match: Wildcard pattern
- Request URL:
http://*
- Request URL:
- Then:
- Target URL:
https://${1} - Status code: 301
- Preserve query string: 有効
- Target URL:
- If incoming requests match: Wildcard pattern
-
既存の Page Rule をオフにし、作成したリダイレクトの動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Single Redirect へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Automatic HTTPS Rewrites をオンにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Automatic HTTPS Rewrites
- Value: On
移行方法:
-
example.comを含む任意のホスト名について、HTTP リンクを常に HTTPS へ書き換える Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: Automatic HTTPS Rewrites
- Value: On
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、ブラウザキャッシュ TTL を 1 日にする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Browser Cache TTL
- Enter Browser Cache TTL: a day
移行方法:
-
example.comを含む任意のホスト名について、ブラウザでのキャッシュ TTL を 1 日にする Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Eligible for cache
- Browser TTL: Override origin and use this TTL
- Input time-to-live (TTL): 1 day
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Browser Integrity Check をオンにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Browser Integrity Check
- Value: On
移行方法:
-
example.comを含む任意のホスト名について、ボットと脅威から守るため Browser Integrity Check をオンにする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: Browser Integrity Check
- Value: On
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Bypass Cache on Cookie をオンにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Bypass Cache on Cookie
- Enter value:
test_cookie
移行方法:
-
example.comを含む任意のホスト名について、Cookietest_cookieを含むリクエストのキャッシュをバイパスする Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" AND Cookie contains "test-cookie" - Expression Editor を使う場合:
(http.host contains "example.com" and http.cookie contains "test-cookie")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Bypass cache
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Cache By Device Type をオンにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Cache By Device Type
- Value: On
移行方法:
-
example.comを含む任意のホスト名について、ユーザーエージェントまたはデバイスタイプに基づいてコンテンツをキャッシュする Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Eligible for cache
- Setting: Cache key
- Cache by device type: On
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Cache Deception Armor をオンにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Cache Deception Armor
移行方法:
-
example.comを含む任意のホスト名について、キャッシュデセプション攻撃から守る Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Eligible for cache
- Setting: Cache key
- Cache deception armor: On
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、すべてのアセットをキャッシュする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Cache Level
- Select Cache Level: Cache Everything
移行方法:
-
example.comを含む任意のホスト名について、キャッシュレベルを調整する Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Eligible for cache
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Cookie test-cookie を含むレスポンスをキャッシュする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Cache on Cookie
- Enter value:
test-cookie
移行方法:
-
example.comを含む任意のホスト名について、Cookietest_cookieを含むレスポンスをキャッシュする Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" AND Cookie contains "test-cookie" - Expression Editor を使う場合:
(http.host contains "example.com" and http.cookie contains "test-cookie")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Eligible for cache
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、ステータスコード 200 から 599 のレスポンスを 1 日間キャッシュする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Cache TTL by status code
- Status code or enter range:
200-599 - Select option: a day
移行方法:
-
example.comを含む任意のホスト名について、ステータスコード200から599のレスポンスを 1 日間キャッシュする Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - 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
- Expression Builder を使う場合:
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、すべてのクエリ文字列パラメーターを対象とするカスタムキャッシュキーを設定する Page Rule を設定しています。
- URL:
*example.com/* - Setting: Custom Cache Key
- Query String: All query string parameters
移行方法:
-
example.comを含む任意のホスト名について、すべてのクエリ文字列パラメーターを対象とするカスタムキャッシュキーを設定する Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Eligible for cache
- Setting: Cache key
- Query string: All query string parameters
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Cloudflare Apps(非推奨)をオフにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Disable Apps
移行方法:
-
example.comを含む任意のホスト名について、Cloudflare Apps(非推奨)を無効にする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: Disable Apps
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
この Page Rules 設定は Polish と Rocket Loader をオフにしていました。関連する Cloudflare 機能は、Configuration Rules で個別にオン / オフできます。
前提:
example.com の全サブドメインと example.com 自身について、Disable Performance(非推奨)の Page Rule を設定しています。
- URL:
*example.com/* - Setting: Disable Performance
置き換え方法:
-
example.comを含む任意のホスト名について、Polish と Rocket Loader を無効にする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Polish: Off
- Rocket Loader: Off
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
この Page Rules 設定は、Email Obfuscation、Rate Limiting(旧バージョン)、Scrape Shield、URL (Zone) Lockdown、WAF マネージドルール(旧バージョン)をオフにします。関連する Cloudflare 機能は、Configuration Rules と WAF カスタムルールで個別にオン / オフできます。
前提:
example.com の全サブドメインと example.com 自身について、Disable Security(非推奨)の Page Rule を設定しています。
- URL:
*example.com/* - Setting: Disable Security
この設定は、次の Cloudflare セキュリティ機能の一部をオフにしていました。Email Obfuscation、Rate Limiting(旧バージョン)、Scrape Shield、URL (Zone) Lockdown、WAF マネージドルール(旧バージョン)です。
置き換え方法:
-
1 つ以上のセキュリティ機能をオフにする Configuration Rule を作成 します。
-
必要なら、許可リスト内の IP アドレスからのリクエストについて、WAF マネージドルールセットの 1 つ以上のルールをスキップする WAF 例外を作成 します。
-
既存の Page Rule をオフにし、作成したルールの動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
前提:
example.com の全サブドメインと example.com 自身について、Zaraz をオフにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Disable Zaraz
移行方法:
-
example.comを含む任意のホスト名について、Zaraz をオフにする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: Disable Zaraz
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Edge Cache TTL を調整する Page Rule を設定しています。
- URL:
*example.com/* - Setting: Edge Cache TTL
- Enter Edge Cache TTL: a day
移行方法:
-
example.comを含む任意のホスト名について、Cloudflare エッジでのキャッシュ TTL を 1 日にする Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- 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
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Email Obfuscation をオフにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Email Obfuscation
- Value: Off
移行方法:
-
example.comを含む任意のホスト名について、Email Obfuscation をオフにする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: Email Obfuscation
- Value: Off
- Setting: Email Obfuscation
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
例 1: www をルートドメインへリダイレクトする
前提:
すべての URI パスで www.example.com を example.com へ恒久リダイレクトする Page Rule を設定しています。
- URL:
www.example.com/* - Setting: Forwarding URL
- Select Status code: 301 - Permanent Redirect
- Destination URL:
https://example.com/$1
移行方法:
-
https://www.example.comへのリクエストをhttps://example.comへ恒久リダイレクトする Single Redirect を作成 します。Redirect from WWW to Root ルールテンプレートを選ぶか、次のルール設定を入力します。- If incoming requests match: Wildcard pattern
- Request URL:
https://www.example.com/*
- Request URL:
- Then:
- Target URL:
https://example.com/${1} - Status code: 301
- Preserve query string: 有効
- Target URL:
- If incoming requests match: Wildcard pattern
-
既存の Page Rule をオフにし、作成したリダイレクトの動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
ルールの同等性に関する注意
同じ例にある従来の Page Rule と、Single Redirects を使った例は完全には一致しません。
完全に同等にするには、HTTP と HTTPS の両方の受信リクエストに一致させる必要があります。次のようなワイルドカードパターンで実現できます(http のあとに追加の * がある点に注意してください)。
- Request URL:
http*://www.example.com/*
あわせて Target URL も、1 番目ではなく 2 番目のワイルドカードキャプチャグループを使うように変更する必要があります(上記パターンの 2 番目の * がキャプチャしたテキストに対応します)。
- Target URL:
https://example.com/${2}
| Page Rules の設定 | Single Redirect へ移行 |
|---|---|
![]() |
![]() |
例 2: 旧パス配下の全ページを新パスへリダイレクトする
前提:
example.com/old-path を example.com/new-path へ恒久リダイレクトする Page Rule を設定しています。
- URL:
example.com/old-path/* - Setting: Forwarding URL
- Select Status code: 301 - Permanent Redirect
- Destination URL:
https://example.com/new-path/$1
移行方法:
-
example.com/old-pathへのリクエストをexample.com/new-pathへ恒久リダイレクトする Single Redirect を作成 します。- If incoming requests match: Wildcard pattern
- Request URL:
https://example.com/old-path/*
- Request URL:
- Then:
- Target URL:
https://example.com/new-path/${1} - Status code: 301
- Preserve query string: 有効
- Target URL:
- If incoming requests match: Wildcard pattern
-
既存の Page Rule をオフにし、作成したリダイレクトの動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
ルールの同等性に関する注意
同じ例にある従来の Page Rule と、Single Redirects を使った例は完全には一致しません。
完全に同等にするには、HTTP と HTTPS の両方の受信リクエストに一致させる必要があります。次のようなワイルドカードパターンで実現できます(http のあとに追加の * がある点に注意してください)。
- Request URL:
http*://example.com/old-path/*
あわせて Target URL も、1 番目ではなく 2 番目のワイルドカードキャプチャグループを使うように変更する必要があります(上記パターンの 2 番目の * がキャプチャしたテキストに対応します)。
- Target URL:
https://example.com/new-path/${2}
| Page Rules の設定 | Single Redirect へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の任意のサブドメインと example.com 自身宛ての全リクエストについて、Host HTTP ヘッダーを example.saas-provider.com に変える Page Rule を設定しています。
- URL:
*example.com/* - Setting: Host Header Override
- Enter value:
example.saas-provider.com
移行方法:
-
example.comを含む任意のホスト名について、Hostヘッダーをexample.saas-provider.comに変える Origin Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- Set origin parameters:
- Host Header > Rewrite to:
example.saas-provider.com
- Host Header > Rewrite to:
- Set origin parameters:
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Origin Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Origin Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の任意のサブドメインと example.com 自身宛ての全リクエストについて、CF-IPCountry HTTP ヘッダーを追加する Page Rule を設定しています。
- URL:
*example.com/* - Setting: IP Geolocation Header
- Value: On
移行方法:
- すべてのリクエストに
CF-IPCountryとその他の位置情報ヘッダーを追加するため、Transform Rules 機能である Add visitor location headers Managed Transform をオン にします。 - 既存の Page Rule をオフにし、Managed Transform の動作を確認します。
- テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Managed Transform へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Opportunistic Encryption をオフにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Opportunistic Encryption
- Value: Off
移行方法:
-
example.comを含む任意のホスト名について、Opportunistic Encryption をオフにする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: Opportunistic Encryption
- Value: Off
- Setting: Opportunistic Encryption
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Origin Cache Control をオフにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Origin Cache Control
- Value: Off
移行方法:
-
example.comを含む任意のホスト名について、エッジキャッシュの動作を決める Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Eligible for cache
- Setting: Origin Cache Control
- Enable Origin Cache Control: Off
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Origin Error Page Pass-thru をオンにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Origin Error Page Pass-thru
- Value: On
移行方法:
-
example.comを含む任意のホスト名について、エッジキャッシュの動作を決める Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- 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
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Polish をオフにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Polish
- Value: Off
移行方法:
-
example.comを含む任意のホスト名について、Polish をオフにする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: Polish
- Select value: Off
- Setting: Polish
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Query String Sort をオンにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Query String Sort
- Value: On
移行方法:
-
example.comを含む任意のホスト名について、キャッシュ用にクエリ文字列パラメーターをソートする Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Eligible for cache
- Setting: Cache key
- Sort query string: On
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の任意のサブドメインと example.com 自身宛ての全リクエストについて、オリジンを example.saas-provider.com に変える Page Rule を設定しています。
- URL:
*example.com/* - Setting: Resolve Override
- Enter value:
example.saas-provider.com
移行方法:
-
example.comを含む任意のホスト名について、オリジンをexample.saas-provider.comに上書きする Origin Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- DNS Record > Override to:
example.saas-provider.com
- DNS Record > Override to:
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Origin Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Origin Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、バイト単位の等価チェックをオンにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Respect Strong ETags
- Value: On
移行方法:
-
example.comを含む任意のホスト名について、strong ETag を尊重する Cache Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then:
- Cache eligibility: Eligible for cache
- Setting: Respect strong ETags
- Use strong ETag headers: On
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Cache Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Cache Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Rocket Loader をオフにする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Rocket Loader
- Value: Off
移行方法:
-
example.comを含む任意のホスト名について、Rocket Loader をオフにする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: Rocket Loader
- Value: Off
- Setting: Rocket Loader
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、Security Level を I'm Under Attack にする Page Rule を設定しています。
- URL:
*example.com/* - Setting: Security Level
- Select Security Level: I'm Under Attack
移行方法:
-
example.comを含む任意のホスト名について、Security Level を I'm Under Attack にする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: I'm Under Attack
- Value: On
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の任意のサブドメインと example.com 自身宛ての全リクエストについて、True-Client-IP HTTP ヘッダーを追加する Page Rule を設定しています。
- URL:
*example.com/* - Setting: True Client IP Header
- Value: On
移行方法:
- すべてのリクエストに
True-Client-IPヘッダーを追加するため、Transform Rules 機能である Add "True-Client-IP" header Managed Transform をオン にします。 - 既存の Page Rule をオフにし、Managed Transform の動作を確認します。
- テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Managed Transform へ移行 |
|---|---|
![]() |
![]() |
前提:
example.com の全サブドメインと example.com 自身について、SSL を Strict にする Page Rule を設定しています。
- URL:
*example.com/* - Setting: SSL
- Select SSL/TLS encryption mode: Strict
移行方法:
-
example.comを含む任意のホスト名について、SSL を Strict にする Configuration Rule を作成 します。- When incoming requests match: Custom filter expression
- Expression Builder を使う場合:
Hostname contains "example.com" - Expression Editor を使う場合:
(http.host contains "example.com")
- Expression Builder を使う場合:
- Then the settings are:
- Setting: SSL
- Select SSL/TLS encryption mode: Strict
- Setting: SSL
- When incoming requests match: Custom filter expression
-
既存の Page Rule をオフにし、作成した Configuration Rule の動作を確認します。
-
テストが成功したら、既存の Page Rule を削除します。
| Page Rules の設定 | Configuration Rule へ移行 |
|---|---|
![]() |
![]() |
次の Page Rules 設定は、他の種類のルールへ移行されません。
- Disable Performance(この設定は非推奨です)
- Disable Railgun(この設定は非推奨です。Railgun は利用できなくなっています)
- Disable Security(この設定は非推奨です)
- Response Buffering(この設定は非推奨です)
- Web Application Firewall(この設定は非推奨です。WAF マネージドルールの旧バージョンは非推奨です)
その他の Page Rules 設定は、2025 年中に移行されます。
フィードバックがある場合は、Community スレッド ↗ を参照してください。





























































