Skip to content

Commit 16f74c0

Browse files
authored
Update redirect-all-another-domain.mdx
Replacing unnecessarily cumbersome Bulk Redirect for a hostname with an easier Single-Redirect Rule.
1 parent 2d3dd92 commit 16f74c0

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

src/content/docs/rules/url-forwarding/examples/redirect-all-another-domain.mdx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,26 @@ description: Create a redirect rule to redirect all requests to a different
1313

1414
In this example the original domain was replaced with a different domain. All functionality was maintained, except for the HTTP service (port 80) which was discontinued.
1515

16-
1. Create a Bulk Redirect List with the following URL redirect:
16+
<Example>
1717

18-
- **Source URL**: `example.com/`
19-
- **Target URL**: `https://example.net/`
20-
- **Subpath matching**: Enabled
21-
- **Preserve query string**: Enabled
18+
**When incoming requests match**
2219

23-
2. Create a Bulk Redirect Rule that enables this list.
20+
- **Wildcard pattern**
21+
- **Request URL**: `http*://example.com/*`
22+
23+
**Then**
24+
25+
- **Target URL**: `https://example.net/${2}`
26+
- **Status code:** _301_
27+
- **Preserve query string:** Enabled
28+
29+
</Example>
2430

2531
This configuration will perform the following redirects:
2632

27-
| Request URL | URL after redirect |
28-
| ----------------------------------------- | ----------------------------------------- |
29-
| `http://example.com/` | `https://example.net/` |
30-
| `https://example.com/` | `https://example.net/` |
31-
| `https://example.com/my/path/to/page.htm` | `https://example.net/my/path/to/page.htm` |
32-
| `https://example.com/search?q=term` | `https://example.net/search?q=term` |
33+
| Request URL | URL after redirect | Status code |
34+
| ----------------------------------------- | ----------------------------------------- | ----------- |
35+
| `http://example.com/` | `https://example.net/` | `301` |
36+
| `https://example.com/` | `https://example.net/` | `301` |
37+
| `https://example.com/my/path/to/page.htm` | `https://example.net/my/path/to/page.htm` | `301` |
38+
| `https://example.com/search?q=term` | `https://example.net/search?q=term` | `301` |

0 commit comments

Comments
 (0)