この例では、元のドメインを別のドメインに置き換えています。HTTP サービス(ポート 80)を廃止した点を除き、機能は保っています。
次の設定で リダイレクトルールを作成 します。
受信リクエストが次に一致する場合
- Wildcard pattern
- Request URL:
http*://example.com/*
- Request URL:
その場合
- Target URL:
https://example.net/${2} - Status code: 301
- Preserve query string: 有効
この設定は、次のようにリダイレクトします。
| リクエスト URL | リダイレクト後の URL | ステータスコード |
|---|---|---|
http://example.com/ |
https://example.net/ |
301 |
https://example.com/ |
https://example.net/ |
301 |
https://example.com/my/path/to/page.htm |
https://example.net/my/path/to/page.htm |
301 |
https://example.com/search?q=term |
https://example.net/search?q=term |
301 |