Vue Storefront is now Alokai! Learn More
Redirects

Redirects

The documentation only applies to instances deployed on Alokai@Edge.

Redirects only work with Custom Domains. If no custom domain is configured, redirect settings will have no effect.

Redirects allow you to forward incoming traffic from one URL to another. They are useful for maintaining SEO, handling domain changes, or ensuring consistent URL structures.

General behavior

  • Two redirect types are available: Predefined rules and Custom rules.
  • Both types can be active at the same time.
  • Custom rules take priority — if a request matches both a Custom and Predefined rule, the Custom rule applies.
  • Predefined rules apply only to hosts and paths not covered by Custom rules.
  • Changes may take a few minutes to propagate.

Predefined rules

Predefined rules apply simple, opinionated transformations to your domain. You can choose:

  1. WWW redirect – forwards example.comwww.example.com (requires example.com to be added as a custom domain first).
  2. Non-WWW redirect – forwards www.example.comexample.com (requires www.example.com to be added as a custom domain first).

You can also enable:

  • Remove trailing slash – automatically normalizes paths by removing / at the end of URLs.

Custom rules

Custom rules allow you to define exact URL-mapping logic by uploading a CSV file.

Rules

  • File format: host/old/path,newhost/new/path (no headers).
  • Up to 500 redirects are supported.
  • Each record can be up to 256 characters long.
  • Regular expressions (REGEX) are supported for flexible matching. Example: /your-custom.domain/old-path/(product-[^/]+)/details,your-custom.domain/new-path/\1
  • A custom domain must be set up for redirects to work.
  • Uploading a new file replaces the entire redirect list.
  • If validation errors occur, the system displays the problematic rows.
  • Host redirection (changing domains) is supported but requires both source and target domains to be set within the rules.
  • regsub will replace only the first matching group. Include hosts (domains) if there is a risk of overlap.

Tips

  • Always download the current file before uploading changes. Since new uploads overwrite the entire list, you must re-include existing redirects along with new ones.
  • Contact Customer Support if you need more than 500 redirects.

Steps

  1. Prepare a CSV file with your redirect rules.
  2. Upload the file in the Custom rules section.
  3. Enable Custom rules.
  4. (Optional) Download the current file to make modifications before future uploads.
  5. To remove custom rulase, disable the feature and delete the file.

CSV Template

You can download a CSV template directly in Console.

Examples

Old URLNew URLResultDescription
/old-path/(product-[^/]+)/details/new-path/\1/info/new-path/product-X/inforetain product ID
/product-([^/]+)/color-([^/]+)/product/\1-with-color-/\2/product-X-with-color-Yretain both product ID and color
your-custom.domain/old-path/(product-[^/]+)different.domain/new-path/\1different.domain/new-path/product-XURL with new host and path structure
/product/([^/]+).html/products/list/\1/products/list/someproduct.htmlsimple path redirect

CSV structure with data taken from the above examples:

/old-path/(product-[^/]+)/details,/new-path/\1/info
/product-([^/]+)/color-([^/]+),/product/\1-with-color-/\2
your-custom.domain/old-path/(product-[^/]+),different.domain/new-path/\1
/product/([^/]+).html,/products/list/\1

Best practices

  • Use Predefined rules for domain normalization (www vs non-www, trailing slashes).
  • Use Custom rules for SEO migrations (product URL changes, category reorganizations).
  • Keep the list clean — remove obsolete rules to avoid confusion and unnecessary hops.
  • Test changes after enabling, especially when using REGEX, to prevent accidental loops or broad matches.