/example-proxy
that
proxies requests to deco.cx and a route /example-redirect
that redirects to
the homepage of google.com. Note the difference: the first will keep you within
the same domain, while the latter will take you outside the domain of your site.
Adding a redirect
1. Access the Redirects Page
Access theredirects
page. This allows access to redirect creation.

2. Press the Create a redirect button
Configure the redirect according to your needs:- From: the source field, which represents the path that the user is trying to access and where they will be redirected. This field supports URLPattern.
- To: the destination field. It can be an absolute address or a relative path.
- Type: the definition of the redirect type (
permanent
ortemporary
)
Choose the type astemporary
when the redirect may change over time. If the redirect should not change over time, you can selectpermanent
(which may result in faster responses, as permanent redirects are cached by the user’s browser).

3. Create the redirect
To make the redirect take effect, you need to publish the changes to your site. Then, you can accesshttps://your-site.deco.site/example-redirect
and check if
the redirect is working correctly.
Adding a Proxy [via ecommerce apps and website]
Proxies are used when you want to keep the user within the same site but provide different content. Proxies allow the sharing of resources under the same domain, providing a unified user experience. This can be especially useful when you need to serve content from different sources or platforms while maintaining a consistent user interface. Proxies are commonly used during platform migration processes, allowing you to gradually adopt Deco and decide whether a specific page should be proxied or served directly by Deco. To create or edit a proxy instead of a redirect, you can follow these steps:1. Access the Site App
Access the site app view and look for the Site App. To edit it, click on the app description.
2. Look for the Routes Map
Look for the routes map property in the app’s editing form.
Adding a redirects file.
Repeat step 1 from the previous section and look for theRoute Maps
.
Then:
-
Upload a file like
redirect.csv
to the project’s base. It should have the indicated format below: -
Add the route of type
redirectsFromCsv.ts
. -
Select
redirect.csv
as the redirects file. - Publish the changes.