Configure MRT Routing Rules in Business Manager
Starting with B2C Commerce version 25.4, you can configure routing rules for embedded content delivery network (eCDN) by using Business Manager as an alternative to the createCustomRule API (CDN API).
By using Business Manager instead of the CDN API to route traffic to your Managed Runtime (MRT) environment, you can:
- Speed up CDN setup with an intuitive UI.
- Simplify deployment processes.
This guide explains how to use Business Manager to view, create, edit, or delete routing rules for zones in a Progressive Web App (PWA) Kit site or hybrid storefront.
This guide applies to you if you’re using eCDN, it doesn’t apply if you’re using the MRT CDN or a third-party CDN. See Decide which CDN to Use.
Before you configure routing rules:
- Define your hostnames in the alias file. To do so, in Business Manger, navigate to Merchant Tools > SEO > Aliases.
- Find the zone ID of the eCDN zone to be used with Managed Runtime. To get this info, use the getZonesInfo endpoint of the CDN Zones API.
- Complete the steps under Before You Begin.
Here are a few points to consider when you create a rule expression:
- Include one expression per rule.
- You can set up all paths or specific paths for a particular hostname to be forwarded to MRT.
- When you create or edit a routing rule, if you don’t provide paths in a rule expression and you select only a hostname, all traffic is routed to MRT.
- The structure of the rule expression differs slightly when creating rules using Business Manager instead of the CDN API. When you configure rules in Business Manager, leave the http.host field out of the rule expression. You select the hostnames separately on the page, and they’re automatically prepended to the rule expression during rule creation. Requests are directed to your specified MRT origin.
- If you provide a single path, the path condition is combined with the host condition using an "AND" operator. This means that both the host and the path conditions must be true for the rule to take effect.
- When you provide multiple paths using an "OR" operator, if any of the specified paths match, the rule takes effect.
In this example, the rule applies if the URL path starts with either /products
or /be/fr/home-page
followed by any number of characters.
http.request.uri.path matches "^/products" or http.request.uri.path matches "^/be/fr/home-page.*"
For more examples, see Create a Routing Rule.
Routing rules are configured per zone.
- In Business Manager, navigate to the Embedded CDN Settings page.
- Locate the zone you wish to view.
- Click on the caret dropdown to the right of the zone.
- Select Configure Routing Rules.
The following page displays the existing routing rules for the selected zone. Click the caret icon next to each rule to expand or collapse the rule details. You can also use the search bar to quickly filter rules by name.
To route traffic to a Managed Runtime environment, create a routing rule.
- In Business Manager, on the Configure Routing Rules page, click New Rule.
- Fill out the required input fields. Refer to the tooltips for additional information regarding each field.
- (Optional) A few rule templates are available to help you get started. They provide a foundation for building rule expressions based on your specific use case. For some key points that apply to rule expressions, see Considerations.
This example shows how to route all traffic to MRT.
- On the Rule Template list, select Recommended Fully Composable.
- Leave the Rule Expression field blank.
This example shows how to route only specific paths to MRT.
- On the Rule Template list, make a selection.
- In the Rule Expression field, enter specific paths to route to MRT.
- Click Save.
- When the confirmation message appears, click Save again to create the rule.
After a moment, the newly created rule is visible on the Configure Routing Rules page.
You can update an existing routing rule. For example, you can route traffic to a different Managed Runtime environment or make updates if the structure of your site URLs changed.
- In Business Manager, on the Configure Routing Rules page, locate the routing rule you wish to edit.
- Click Edit.
- Update the fields as desired. For some key points that apply to rule expressions, see Considerations.
- Click Save.
- When the confirmation message appears, click Save again to update the rule.
After a moment, the updated rule is visible on the Configure Routing Rules page.
If you're switching to a third-party CDN or you no longer want to route a particular path from eCDN to MRT, you can delete a routing rule.
- In Business Manager, on the Configure Routing Rules page, locate the routing rule you wish to edit.
- Click Delete/Trash.
- When the confirmation message appears, click Delete to delete the rule.
After a few seconds, the rule is removed from the Configure Routing Rules page.
- Decide which CDN to Use
- CDN APIs for Hybrid Implementations
- Pre-Build and Go-Live Best Practices Checklist
- Launch Your Storefront