Skip to content

Commit 1079fdb

Browse files
cf-scottpedrosousa
andauthored
[Rules] Redirects: Update redirect-all-another-domain.mdx (#24163)
Replacing unnecessarily cumbersome Bulk Redirect for a hostname with an easier Single-Redirect Rule. --------- Co-authored-by: Pedro Sousa <[email protected]>
1 parent 90a6e40 commit 1079fdb

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

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

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,32 @@ description: Create a redirect rule to redirect all requests to a different
1010
service (port 80).
1111
---
1212

13-
import { Steps } from "~/components";
13+
import { Example } from "~/components";
1414

1515
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.
1616

17-
<Steps>
17+
[Create a redirect rule](/rules/url-forwarding/single-redirects/create-dashboard/) with the following configuration:
1818

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

21-
- **Source URL**: `example.com/`
22-
- **Target URL**: `https://example.net/`
23-
- **Subpath matching**: Enabled
24-
- **Preserve query string**: Enabled
21+
**When incoming requests match**
2522

26-
2. Create a Bulk Redirect Rule that enables this list.
23+
- **Wildcard pattern**
24+
- **Request URL**: `http*://example.com/*`
2725

28-
</Steps>
26+
**Then**
27+
28+
- **Target URL**: `https://example.net/${2}`
29+
- **Status code:** _301_
30+
- **Preserve query string:** Enabled
31+
32+
</Example>
2933

3034
This configuration will perform the following redirects:
3135

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

0 commit comments

Comments
 (0)