Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

ドメインへのリクエストを新しいドメインへリダイレクトする

ドメインのすべての URL を、新しいドメインのルートへ向けるリダイレクトルールを作成します。旧ドメインのサブドメインも含みます。

最終更新 Markdown で表示Agent セットアップ

この例では、旧サイトが終了し、別ドメインの新しいサイトに置き換わっています。機能は異なり、すべての URL は新しいドメインのルートを指す必要があります。旧ドメインのサブドメインも同様です。

リダイレクトルールを作成 し、次の設定にします。

When incoming requests match

  • Wildcard pattern
    • Request URL: http*://*example.com/*

Then

  • Target URL: https://example.net/
  • Status code: 301

たとえば、このリダイレクトルールは次のようにリダイレクトします。

リクエスト URL 対象 URL ステータスコード
http://example.com/ https://example.net/ 301
https://example.com/ https://example.net/ 301
https://subdomain.example.com/ https://example.net/ 301
https://example.com/my/path/to/page.htm https://example.net/ 301
https://example.com/search?q=term https://example.net/ 301

役に立ちましたか?