Route mapping
On this page
Route mappings control what happens when a visitor lands on a URL that has changed. There are three types:
- 301 Permanent — redirects the visitor to the new URL and passes SEO value to the destination.
- 302 Temporary — redirects the visitor to a new URL without passing SEO value.
- Rewrite — serves the destination’s content at the original URL, with no visible redirect.
StoreConnect automatically creates a 301 route mapping whenever a slug or path changes on any of these records:
- Product
- Product Category
- Page
- Article
- Article Category
Route mapping records can be deleted when a redirect is no longer needed. Find them in the StoreConnect console under Configuration > Advanced > Route mappings (s_c__Route_Mapping__c).
A slug must be unique for each product. A path must be unique for each store, meaning two pages can share a path if they belong to different stores.
:::tip If you get a “slug or path must be unique” error but cannot find a conflicting record, check the route mappings. A previous version of that path may still be referenced there — delete the stale route mapping to free up the path. :::
Routing from one domain to another
Some DNS providers let you configure a domain-level redirect directly. If yours does, set the destination URL in your DNS settings and optionally append a UTM tracking code. Any orders placed by visitors arriving via that redirect carry the UTM code, so you can see which domain referred them.
If your DNS host does not support this, you can use StoreConnect to handle it instead.
Create a store that runs on the domain you want to route from, with the following configuration:
- Create an empty homepage.
- Create an empty taxonomy for this store.
-
Create a content block with the Content Template set to
No added styling, and put this in its Content field:```html
```
Replace
domain-to-route-to.comwith the destination domain. Theutm_sourceparameter is optional; if you keep it, replace{domain-routing-from}with a label for the source domain, braces included. - Set the HTML Head Content Block field on the Store record to this content block.
- Set the Domain field on the Store record to the domain you are routing from.
- Add the relevant CNAME records on your domain.
Anyone who arrives on that site triggers the redirect embedded in the page’s head and is sent to the intended destination. If you include UTM tracking in the URL, any orders placed carry the UTM code so you can see which domain referred the customer.
Migrating to StoreConnect
When migrating an existing site into StoreConnect, create Route Mapping records to redirect your old URLs to their new equivalents. This ensures search engines and external links continue to send traffic to the right pages. This approach works for same-domain migrations where you can use relative paths. Records can be bulk uploaded with a tool like dataloader.io.
Products use /products/ as the path prefix before the slug by default. Change this by editing the Product2 URL Path setting in your org’s Custom Metadata Types in Salesforce Setup.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.