Loading
Feature degradation | Gmail Email delivery failureRead More
Experience Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Key Concepts in Page Redirection in Aura and LWR Sites

          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, /target

          Keep 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
          Note
          Note Dynamic redirects don't work for URLs that start with /secur, end with .css, or have lastmod=.

          Redirect Users to Your Aura and LWR Site Pages

          Set up page redirects on your Aura and LWR sites in Experience Cloud. To set up URL redirects from a page in your site to an external target, add the source and target URLs to a CSV file and then import the file in the Administration workspace.

          Required Editions

          User Permissions Needed
          To create an Experience Cloud site: Create and Set Up Experiences AND View Setup and Configuration
          To customize or publish an Experience Cloud site:
          • Create and Set Up Experiences AND View Setup and Configuration AND be a member of the site

            OR

          • View Setup and Configuration AND be a member of the site AND have appropriate role-based site access

          To delete or deactivate existing redirects, use the Lightning Platform REST API to interact with the SiteRedirectMapping object. Don’t import a blank CSV file from the URL Redirects page.

          Keep these points in mind when importing CSV files:

          • The redirects go live as soon as you upload them successfully.
          • If you import a new CSV file, it overwrites the existing redirect file. 
          • The CSV file of redirects has a 4-MB file size limit. 
          URL Redirects user interface, showing where you can import the CSV file
          1. In Experience Workspaces, go to Administration | URL Redirects | Import
          2. If you plan to add URL redirects without replacing existing redirect rules, first export your existing redirects as a CSV file. 
          3. Add the new URLs to the file that you downloaded, and then import the CSV file again. If the file size is 10,240 bytes or smaller and uploads successfully, a summary of your most recent import appears on the URL Redirects page. If the file size exceeds 10,240 bytes, or if the total number of URLs previously imported is more than 100, an email notifies you of the import status.
          Example
          Example CSV for Internal Redirects

          In this example, https://MyDomainName.com/TargetSite/s/account/001RM000005Su9JYAS/acme redirects to https://MyDomainName.com/TargetSite/s/newaccount/001RM000005Su9JYAS/acme.

          This example outlines the format to use when redirecting from one Experience Builder site page to another page in the same site.

          /source, /target
          /TargetSite/s/account/001RM000005Su9JYAS/acme, /newaccount/001RM000005Su9JYAS/acme
          

          If a source URL’s page is still available to users, internal redirects from that URL occur only if a user navigates to the source URL by using their browser. If a user clicks an available source URL through a site page, such as Global Search Results or Top Articles, the user is directed to that URL instead and isn’t redirected to the target URL.

          CSV for External Redirects in Aura Sites

          In this example, https://MyDomainName.com/case/oldCaseLocation redirects to https:// MyDomainName.com/TargetSite/s/case/500RM000003UjsEYAS/my-case-2.

          This example outlines the format to use when creating external redirects. For the source URL, include everything after the domain name. For the target URL, include everything after /s.

          /source, /target
          /case/oldCaseLocation, /case/500RM000003UjsEYAS/my-case-2
          CSV for Dynamic URL Redirect Rules in Aura and LWR Sites

          A URL comprises path segments that are separated by a “/”. For example, /path/to/source has three path segments: path, to, and source. An asterisk (*) denotes a wildcard that can match any text on the source side. If you use a variable in the source URL, you must also use it in the target URL.

          A simple example of a dynamic redirect rule is /prod/pid/(productId), /product/(productId), where (productId) is a variable. Here's a sample CSV file that includes this rule:

          /source, /target 
          /prod/pid/(productId), /product/(productId)

          A customer enters the URL https://www.my.company.salesforce.com/prod/pid/prd-123

          In this case, the prod/pid/prd-123 part of the URL matches the /prod/pid/(product) source.

          So the customer is redirected to the target https://www.my.company.salesforce.com/product/prd-123.

          Consider a scenario that uses a wildcard for redirects. If you add the rule:

          /path/*/category, /categories/category-abc-slug

          And the customer enters https://www.my.company.salesforce.com/path/id/category.

          Then the source /path/id/category part of the URL matches the /path/*/category source, and as a result, the customer is redirected to https://www.my.company.salesforce.com/path/categories/category-abc-slug.

          You can use multiple variables and multiple wildcards, but only one variable and wildcard per path segment.

           
          Loading
          Salesforce Help | Article