Regex Path

Regex paths redirect multiple URLs to a single URL. For example, a billing system may use the customer's contract ID in the URL, as in the following examples:

  • www.example.com/Billing/374-3D3-AK4/
  • www.example.com/Billing/F92-K52-V88/
  • www.example.com/Billing/98D-NMK-3S2/

You can then create a regex path to normalize the URLs above so that all users go to www.example.com/Billing/.

Creating a regex path

On the navigation bar, go to Settings button settings > Property Settings > Regex Path and click + Add Regex Path.

Add regex path screen

In the billing system example above, the following regexes can be used:
RegexReplacement
^Billing/[A-Z0-9]{3}-[A-Z0-9]{3}-[A-Z0-9]{3}/$Billing/
^(.+)/[A-Z0-9]{3}-[A-Z0-9]{3}-[A-Z0-9]{3}/$$1/
The first regex is more precise, only matching URLs that start with "Billing", while the second regex matches any URL ending with a contract ID and retaining the start of the URL. In both of these examples, all three URLs above will be converted to www.mywebsite.com/Billing/.

Regex paths must be configured in the DXA portal, after which the rule will apply to all subsequently recorded pageviews.