You are here:
Key Concepts in Page Redirection in Aura and LWR Sites
Page redirects help maintain the discoverability and SEO equity of your sites in Experience Cloud. Learn some of the key concepts and considerations before you set up page redirection in your Aura and Lightning Web Runtime (LWR) sites.
Internal Redirects
To redirect users away from one Experience Builder site page to another page on the same site, create an internal redirect. To configure internal redirects for a site that exists on multiple domains, create redirect entries with the corresponding path prefixes for all of the domains. For example:
MyDomainCommunity/s/source, /target
/CustomDomainCommunity/s/source, /targetKeep the following in mind when creating an internal redirect:
- The source URL is the Experience Builder site page that you want to direct your users away from.
- The target URL is the page in the same Experience Builder site that you want to redirect your users to.
- For the source and target URLs, include everything after the domain name.
- Only use the root path as the source URL if the site where you configure the redirect is hosted on the root of the domain.
- Include the path prefix in the source URL, but not the target. For the target URL in Aura sites, this means including everything after the /s.
- Server-side URL redirect rules run when the web server handles a request for a path. Client-side navigation doesn’t go through the same request flow, so it doesn’t respect the server-side rules in the same way.
External Redirects
You can also set up external redirects, which redirect users to or from a page outside of your Aura or LWR site. Keep the following in mind when creating external redirects:
- To create an external redirect, add the source and target URLs to a CSV file.
- The source URL is the page that you want to direct your users away from.
- The target URL is the page that you want to redirect your users to.
- Only use the root path as the source URL if the site where you configure the redirect is hosted on the root of the domain.
Static and Dynamic Redirects
Static page redirects point a user from one URL to another. You essentially tell Salesforce where to send a user based on the URL they were trying to reach. Let’s say your users are trying to reach www.mysite.com/homepage. However, you’ve replaced the site with www.mysite.com/home-page. At that point, you create a redirect from the first site to the second.
Dynamic URL redirect rules use a pattern to identify a URL and automatically redirect a user to a new URL based on that pattern. Dynamic rules are especially helpful when you create user-friendly URL slugs for custom objects and your product and category pages in Salesforce B2C Commerce stores. Keep these points in mind when creating dynamic redirect rules:
- There’s a limit of 100 dynamic redirect rules per org.
- Redirect rules require a source and a target.
- You can use dynamic redirect rules for internal and external redirects.
When using dynamic rules, the system compares the URL that the customer enters to the source URL. If the patterns match, then the customer is redirected to the target URL.
Aura and LWR sites support static and dynamic redirects:
- From registered custom domain URLs previously hosted outside Salesforce
- To URLs hosted outside Salesforce
- Between site pages hosted on Salesforce domains
- That include query params in source and target URLs
/secur, end
with .css, or have lastmod=.
