Skip to content

Commit c76b913

Browse files
cf-scottpedrosousa
authored andcommitted
[Rules] Redirects: Update redirect-all-different-domain-root.mdx (#24162)
Retaining the example URLs from the original Bulk Redirect instructions, replace Bulk Redirect with an easier-to-use Wildcard Redirect Rule. --------- Co-authored-by: Pedro Sousa <[email protected]>
1 parent 6d9301b commit c76b913

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,32 @@ description: Create a redirect rule to redirect all URLs for a domain to point
88
to the root of a new domain, including any subdomains of the old domain.
99
---
1010

11-
import { Steps } from "~/components";
11+
import { Example } from "~/components";
1212

1313
In this example, an old website was discontinued and replaced by a new one in a different domain. The functionality is different, and all URLs should now point to the root of the new domain. The same applies to any subdomains of the old domain.
1414

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

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

19-
- **Source URL**: `example.com/`
20-
- **Target URL**: `https://example.net/`
21-
- **Subpath matching**: Enabled
22-
- **Include subdomains**: Enabled
23-
- **Preserve path suffix**: Disabled
19+
**When incoming requests match**
2420

25-
2. Create a Bulk Redirect Rule that enables this list.
21+
- **Wildcard pattern**
22+
- **Request URL**: `http*://*example.com/*`
2623

27-
</Steps>
24+
**Then**
2825

29-
This configuration will perform the following redirects:
26+
- **Target URL**: `https://example.net/`
27+
- **Status code:** _301_
3028

31-
| Request URL | URL after redirect |
32-
| ----------------------------------------- | ---------------------- |
33-
| `http://example.com/` | `https://example.net/` |
34-
| `https://example.com/` | `https://example.net/` |
35-
| `https://subdomain.example.com/` | `https://example.net/` |
36-
| `https://example.com/my/path/to/page.htm` | `https://example.net/` |
37-
| `https://example.com/search?q=term` | `https://example.net/` |
29+
</Example>
30+
31+
For example, the redirect rule would perform the following redirects:
32+
33+
| Request URL | Target URL | Status code |
34+
| ----------------------------------------- | ---------------------- | ----------- |
35+
| `http://example.com/` | `https://example.net/` | `301` |
36+
| `https://example.com/` | `https://example.net/` | `301` |
37+
| `https://subdomain.example.com/` | `https://example.net/` | `301` |
38+
| `https://example.com/my/path/to/page.htm` | `https://example.net/` | `301` |
39+
| `https://example.com/search?q=term` | `https://example.net/` | `301` |

0 commit comments

Comments
 (0)