Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,32 @@ description: Create a redirect rule to redirect all URLs for a domain to point
to the root of a new domain, including any subdomains of the old domain.
---

import { Steps } from "~/components";
import { Example } from "~/components";

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.

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

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

- **Source URL**: `example.com/`
- **Target URL**: `https://example.net/`
- **Subpath matching**: Enabled
- **Include subdomains**: Enabled
- **Preserve path suffix**: Disabled
**When incoming requests match**

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

</Steps>
**Then**

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

| Request URL | URL after redirect |
| ----------------------------------------- | ---------------------- |
| `http://example.com/` | `https://example.net/` |
| `https://example.com/` | `https://example.net/` |
| `https://subdomain.example.com/` | `https://example.net/` |
| `https://example.com/my/path/to/page.htm` | `https://example.net/` |
| `https://example.com/search?q=term` | `https://example.net/` |
</Example>

For example, the redirect rule would perform the following redirects:

| Request URL | Target URL | Status code |
| ----------------------------------------- | ---------------------- | ----------- |
| `http://example.com/` | `https://example.net/` | `301` |
| `https://example.com/` | `https://example.net/` | `301` |
| `https://subdomain.example.com/` | `https://example.net/` | `301` |
| `https://example.com/my/path/to/page.htm` | `https://example.net/` | `301` |
| `https://example.com/search?q=term` | `https://example.net/` | `301` |
Loading