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.
Create a redirect rule with the following configuration:
When incoming requests match
- Wildcard pattern
- Request URL:
http*://*example.com/*
- Request URL:
Then
- Target URL:
https://example.net/ - Status code: 301
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 |