Skip to content

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

管理画面へのリクエストを HTTPS へリダイレクトする

store.example.com の管理画面へのリクエストを HTTPS へリダイレクトし、元のパスとクエリ文字列を保つリダイレクトルールを作成します。

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

この例は、ゾーン example.com のシングルリダイレクトです。特定サブドメイン(store.example.com)の管理画面へのリクエストを HTTPS へリダイレクトし、元のパスとクエリ文字列を保ちます。

受信リクエストが次に一致する場合

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

その場合

  • Target URL: https://store.example.com/admin${1}
  • Status code: 301
  • Preserve query string: 有効

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

リクエスト URL ターゲット URL ステータスコード
http://store.example.com/admin/products/ https://store.example.com/admin/products/ 301
https://store.example.com/admin/products/ (変更なし) n/a
http://store.example.com/admin/?logged_out=true https://store.example.com/admin/?logged_out=true 301
http://store.example.com/?all_items=true (変更なし) n/a
http://example.com/admin/ (変更なし) n/a

役に立ちましたか?