Skip to main content
All CollectionsManaging URL redirects
Understanding partial path matching
Understanding partial path matching

Learn how to use the partial path matching setting to get more of your audience where they need to go.

Updated over a month ago

If you have a source URL with a path (the part after the domain name) that has multiple components (ex. https://www.someurl.com/path1/path2) you may not be prepared, or able, to configure all potential redirects to ensure your audience finds you. Save resources by utilizing the flexibility of partial path matching.

You can utilize path forwarding or query parameter forwarding with partial path matching giving you many options to capture traffic efficiently, and ensure your audience gets to their destination. Partial path matching works as a catch-all for your redirects when certain rules are applied.

How to use partial path matching

On select plans, partial path matching can be indicated by using two asterisks (**) in the portion of the source URL you would like to become a partial path wildcard. Partial path matching works in two positions: starts with and ends with. You can only partial path match once per URL.

Starts with

A 'starts with' partial path match means that the source URL path starts with the text you specify. For example, to redirect all source URLs starting with "/news/" you can use the following configuration.

With the above configuration, all requests to URLs such as example.com/news/articles/breaking-story.html will be redirected to the target URL news.destination.com/articles/breaking-story.html. Note that the matched portion of the path, news/, is not forwarded. You can simply append this to the target URL if it is required.

Ends with

An 'ends with' partial path match means that the source URL path ends with the text you specify. For example, to redirect all source URLs ending in ".pdf" you can use the following configuration.

In the above example, all requests for URLs such as example.com/path/to/files/document.pdf will be redirected to the target URL media.destination.com/path/to/files/document.pdf

Forwarding your partial path match

The captured portion in the source URL of your partial path match can be forwarded to your target URL. The captured portion can be used in either the path or the query parameters of your target URL.

Match forwarding works similarly to capturing a group in a regex pattern and using it in the target URL.

To use match forwarding, add {{match}} to your target URL to signal where the matched portion from your source URL should be included. For example:

source-site.com/**/jobs -> target-site.com/{{match}}/about/employment will redirect requests for source-site.com/en-us/jobs to target-site.com/en-us/about/employment.

Important items to note:

  • The partial path matching feature only matches on paths. It will not match on hostnames, query parameters or fragments.

  • Be aware of forward slashes at the end of your source URLs and how that may impact the URL your visitor is forwarded to. If you are using path forwarding, this will be especially important to keep an eye on.

  • If path forwarding is being used on an 'ends with' partial path match, the whole path will be forwarded including the matched portion and anything after.

  • We recommend testing various permutations of your source URLs when you are setting up partial path matching.

What order will my redirect rules be applied?

Check out our article on understanding URL redirection processing to find out more about how traffic is served.

Questions on partial path matching that haven't been answered? We are happy to help, just get in touch!

Did this answer your question?