> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.unicornplatform.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to redirect from one domain to another and save the path in the URL


how to set up a redirect from one domain to another and save the path in the URL

### 1. Add domain to Cloudflare account. 

### 2. Navigate to the Page Rules Section and click on the "Create Page Rule" button

![](https://storage.crisp.chat/users/upload/session/2ca385edc9148400/chrome0fbr4exhaw_fz2m3l.png)

### 3. Configure the Page Rule:
- In the “URL (required)” field, enter `*domain1.com/*`. The asterisk (*) acts as a wildcard to match any subdomain and path.
- Select the setting “Forwarding URL” from the drop-down menu.
- Choose the status code “301 - Permanent Redirect.”
- In the “Enter destination URL” field, enter `https://domain2.app/$1`. The $1 ensures that the path from the old URL is appended to the new URL.

![](https://storage.crisp.chat/users/helpdesk/website/7e782a40c0560c00/applicationframehostlt0sa0p8rq_1pp3up0.png)

### 4. Click “Save and Deploy” to apply the rule.

### 5. Navigate to the Redirect Rules Section and click on the "Create Rule" button

![](https://storage.crisp.chat/users/upload/session/2ca385edc9148400/chromeruixkgqaln_1cjglgu.png)

### 6. Configure the Redirect Rule

- Add Rule name 
- in "If..." section mark "All incoming requests"
- setup "Then..." section as shown on the screenshot
- in "Expression" field add `concat("https://domain2.app",http.request.uri.path)`

![](https://storage.crisp.chat/users/helpdesk/website/7e782a40c0560c00/applicationframehost1trnyvyvmo_1q8scyr.png)

### 7. Click “Deploy” to apply the rule.

### 8. Navigate to the DNS -> Records Section and make sure you have Proxied enabled for domain1.com

![](https://storage.crisp.chat/users/upload/session/2ca385edc9148400/chrome7iijamshd1_swwb6k.png)

### 9. Wait a while for the changes to take effect, after which you can check the redirect’s